![]() |
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) |
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 | CancelAudioVideoMedia () |
Makes new thread to request cancel of audio and video so it won't block ui thread. More... | |
void | UpdateMediaSegment (byte[] data) |
async Task | PingAsync (int interval) |
Sends a keepalive message to server More... | |
Public Attributes | |
UdpMediaDataReceived | UdpMediaDataReceivedEvent |
Properties | |
AsyncReceiver | receiver [get, set] |
Events | |
AssigmentUpdated | AssigmentUpdatedEvent |
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>
Hake_WPF.Connection.Connection | ( | String | username, |
String | password | ||
) |
Creates connection with credentials provided.
username | Username that connection uses |
password | Password that connection uses |
delegate void Hake_WPF.Connection.AssigmentUpdated | ( | ObservableCollection< Assignment > | newConnections | ) |
void Hake_WPF.Connection.CancelAudioVideoMedia | ( | ) |
Makes new thread to request cancel of audio and video so it won't block ui thread.
void Hake_WPF.Connection.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 Hake_WPF.Connection.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> Hake_WPF.Connection.Connect | ( | String | endpointAddress | ) |
Creates receiver and connects to server with wcf and udp.
ObservableCollection<Assignment> Hake_WPF.Connection.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 Hake_WPF.Connection.Disconnect | ( | ) |
Disconnects from server.
ObservableCollection<Assignment> Hake_WPF.Connection.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 Hake_WPF.Connection.IsConnected | ( | ) |
Is Connection on.
async Task Hake_WPF.Connection.PingAsync | ( | int | interval | ) |
Sends a keepalive message to server
<author>Ilkka Rautiainen</author>
interval | ping interval in seconds |
void Hake_WPF.Connection.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 Hake_WPF.Connection.Reconnect | ( | ) |
Reconnects to server.
void Hake_WPF.Connection.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 Hake_WPF.Connection.RequestAudioVideoMedia | ( | ) |
Makes new thread to request audio video so it won't block ui thread.
void Hake_WPF.Connection.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 Hake_WPF.Connection.SendTextMessage | ( | String | message | ) |
Makes new thread to send message to server so it won't block ui thread.
message | Message to be send |
bool Hake_WPF.Connection.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. |
void Hake_WPF.Connection.UpdateMediaSegment | ( | byte[] | data | ) |
UdpMediaDataReceived Hake_WPF.Connection.UdpMediaDataReceivedEvent |
|
getset |
AssigmentUpdated Hake_WPF.Connection.AssigmentUpdatedEvent |