Halyri - Häke
0.9.1
|
Handles communication between server and this client. User must use connect method to connect server. After that user can use rest of the methods to manage connection. Also user should handle most of events, but atleast connectionupdatedevent. More...
Public Member Functions | |
delegate void | AssigmentUpdated (ObservableCollection< Assignment > newConnections) |
Invoked when connection is updated. More... | |
delegate void | AssignmentTakenForHandling () |
Invoked when currentconnection is setted. More... | |
Connection (String username, String password) | |
Creates connection with credentials provided. More... | |
ObservableCollection< Assignment > | Connect (String endpointAddress) |
Creates receiver and connects to server with wcf and udp. More... | |
bool | UdpSendMedia (MediaInformation mediaInfo, byte[] data, int originalLength) |
Sends media to the server using the active UdpMediaClientSocket instance. Returns true, is the data is successfully queued for sending, otherwise returns false. More... | |
void | ChangePriority (Assignment assignment, Assignment.priorities priority) |
Chances priority to currentconnetion and then updates that to connectionslist and finaly to server. It makes the connection in new thread so it won't block ui thread. More... | |
ObservableCollection< Assignment > | ConvertConnectionsToAssigments (ConnectionDto[] Connections) |
Converts ConnectionDto to Assignment. If location is not set, uses null and do not assign accuracymeters or time from location. If device info is empty, uses empty DeviceInfoDto. More... | |
void | RequestAction (RemoteActionDto action) |
Requests action for current userconnection for currentconnection with given action. CurrentConnection needed or this does nothing. More... | |
void | RequestMeasurementData (MeasurementInstrumentDto instrument) |
If there is currentconnection requests measurements data start from server with given instrument. More... | |
void | CancelMeasurementData (MeasurementInstrumentDto instrument) |
Cancel request to server to stop measurement data sending. Current connection is needed for this. More... | |
bool | IsConnected () |
Is Connection on. More... | |
ObservableCollection< Assignment > | GetAllConnections () |
Should be used only one time to save localy and then use ActiveConnectionsUpdated to update those. Userconnection and converts server response to assignment list. More... | |
bool | Reconnect () |
Reconnects to server. More... | |
bool | Disconnect () |
Disconnects from server. More... | |
void | ProcessAssignment (object assignment) |
Changes assignments state to in progress to server. First it search right connection using guid and then makes the connection currentconnection. More... | |
void | SendTextMessage (String message) |
Makes new thread to send message to server so it won't block ui thread. More... | |
void | RequestAudioVideoMedia () |
Makes new thread to request audio video so it won't block ui thread. More... | |
void | RequestAudioMedia () |
void | CancelAudioVideoMedia () |
Makes new thread to request cancel of audio and video so it won't block ui thread. More... | |
async Task | PingAsync (int interval) |
Sends a keepalive message to server More... | |
Public Attributes | |
UdpMediaDataReceived | UdpMediaDataReceivedEvent |
Properties | |
AsyncReceiver | receiver [get, set] |
Gets and sets AsyncReceiver. More... | |
Events | |
AssigmentUpdated | AssigmentUpdatedEvent |
AssignmentTakenForHandling | AssignmentTakenForHandlingEvent |
Handles communication between server and this client. User must use connect method to connect server. After that user can use rest of the methods to manage connection. Also user should handle most of events, but atleast connectionupdatedevent.
<author>Atte Söderlund</author>
Connection | ( | String | username, |
String | password | ||
) |
Creates connection with credentials provided.
username | Username that connection uses |
password | Password that connection uses |
delegate void AssigmentUpdated | ( | ObservableCollection< Assignment > | newConnections | ) |
Invoked when connection is updated.
newConnections | Connections as Assignments |
delegate void AssignmentTakenForHandling | ( | ) |
Invoked when currentconnection is setted.
void CancelAudioVideoMedia | ( | ) |
Makes new thread to request cancel of audio and video so it won't block ui thread.
void CancelMeasurementData | ( | MeasurementInstrumentDto | instrument | ) |
Cancel request to server to stop measurement data sending. Current connection is needed for this.
<author>Niko Mononen</author>
instrument | Instrument that is sending the data |
void ChangePriority | ( | Assignment | assignment, |
Assignment.priorities | priority | ||
) |
Chances priority to currentconnetion and then updates that to connectionslist and finaly to server. It makes the connection in new thread so it won't block ui thread.
assignment | Assignment that needs updating |
priority | Priority that assignment is to bee changed. |
ObservableCollection<Assignment> Connect | ( | String | endpointAddress | ) |
Creates receiver and connects to server with wcf and udp.
ObservableCollection<Assignment> ConvertConnectionsToAssigments | ( | ConnectionDto[] | Connections | ) |
Converts ConnectionDto to Assignment. If location is not set, uses null and do not assign accuracymeters or time from location. If device info is empty, uses empty DeviceInfoDto.
Connection | ConnectionDto that needs converting to Assigment |
bool Disconnect | ( | ) |
Disconnects from server.
ObservableCollection<Assignment> GetAllConnections | ( | ) |
Should be used only one time to save localy and then use ActiveConnectionsUpdated to update those. Userconnection and converts server response to assignment list.
bool IsConnected | ( | ) |
Is Connection on.
async Task PingAsync | ( | int | interval | ) |
Sends a keepalive message to server
<author>Ilkka Rautiainen</author>
interval | ping interval in seconds |
void ProcessAssignment | ( | object | assignment | ) |
Changes assignments state to in progress to server. First it search right connection using guid and then makes the connection currentconnection.
assignment | Assignment that is to be set as in progress |
bool Reconnect | ( | ) |
Reconnects to server.
void RequestAction | ( | RemoteActionDto | action | ) |
Requests action for current userconnection for currentconnection with given action. CurrentConnection needed or this does nothing.
action | What user wants action to be |
void RequestAudioVideoMedia | ( | ) |
Makes new thread to request audio video so it won't block ui thread.
void RequestMeasurementData | ( | MeasurementInstrumentDto | instrument | ) |
If there is currentconnection requests measurements data start from server with given instrument.
<author>Niko Mononen</author>
instrument | Instrument that provides data |
void SendTextMessage | ( | String | message | ) |
Makes new thread to send message to server so it won't block ui thread.
message | Message to be send |
bool UdpSendMedia | ( | MediaInformation | mediaInfo, |
byte[] | data, | ||
int | originalLength | ||
) |
Sends media to the server using the active UdpMediaClientSocket instance. Returns true, is the data is successfully queued for sending, otherwise returns false.
mediaInfo | Description of the media |
data | Bytes constituting the media data |
originalLength | Length of the media prior to encoding for such encodings that require the length for decompression. |
|
getset |
Gets and sets AsyncReceiver.