![]() |
Halyri - Häke
0.9
|
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... | |
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... | |
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 |
Private Member Functions | |
void | InitializeUdpClient () |
Initializes a new UdpMediaClientSocket instance for media transfer from and to the server. More... | |
void | UdpMediaPacketReceivedHandler (object sender, MediaPacket mediaPacket) |
Handles incoming media packet events from the active UdpMediaClientSocket instance. Republishes them as UdpMediaDataReceivedEvent. More... | |
void | UdpSocketFailedEventHandler (object sender) |
Handles failure events of the active UdpMediaClientSocket. Currently only writes this information to the debug. More... | |
void | ChangePriorityThread (object priority) |
If there is no current connection this will not do anything. If there is it changes current connections priorit and send it to server. More... | |
void | receiver_ConnectionsUpdatedEvent (ConnectionDto[] newConnections) |
Handles when connectionupdates are received. Updates connectionslist and invokes event for update with connectiondto's converted to assignments. More... | |
void | UpdateConnectionsList (ConnectionDto[] newConnections) |
Replaces connections with new connections by comparing their guid. If there is no connection with that guid, adds new connection. More... | |
void | SendMessage (object message) |
Send message to server. More... | |
void | RequestAudioVideoMediaThread () |
Makes request to server for audio and video with hardcoded specs in exampleMediaConfiguration. More... | |
void | CancelAudioVideoMediaThread () |
Request cancel to audio and video from server. It is done by mediaConfigurationdto and setting enableaudio and enablepicture to false. More... | |
Private Attributes | |
const int | udpServerPort = 15103 |
const string | udpServerIp = "130.234.9.165" |
WcfCallCenterServiceClient | client |
string | guid |
InstanceContext | context |
CallCenterConnectionDto | userConnection |
ObservableCollection < ConnectionDto > | connectionDtos = new ObservableCollection<ConnectionDto>() |
ConnectionDto | currentConnection |
UserCredentialsDto | userCredentialsDto |
UdpMediaClientSocket | udpSocket |
bool | isConnected = false |
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 | ) |
Invoked when connection is updated.
newConnections | Connections as Assignments |
void Hake_WPF.Connection.CancelAudioVideoMedia | ( | ) |
Makes new thread to request cancel of audio and video so it won't block ui thread.
|
private |
Request cancel to audio and video from server. It is done by mediaConfigurationdto and setting enableaudio and enablepicture to false.
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. |
|
private |
If there is no current connection this will not do anything. If there is it changes current connections priorit and send it to server.
priority | New priority |
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.
|
private |
Initializes a new UdpMediaClientSocket instance for media transfer from and to the server.
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 |
|
private |
Handles when connectionupdates are received. Updates connectionslist and invokes event for update with connectiondto's converted to assignments.
newConnections | New connections |
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.
|
private |
Makes request to server for audio and video with hardcoded specs in exampleMediaConfiguration.
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 |
|
private |
Send message to server.
message | Message to be send |
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 |
|
private |
Handles incoming media packet events from the active UdpMediaClientSocket instance. Republishes them as UdpMediaDataReceivedEvent.
sender | UdpMediaDataReceivedEvent event punlishing this event |
mediaPacket | The received MediaPacket instance |
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. |
|
private |
Handles failure events of the active UdpMediaClientSocket. Currently only writes this information to the debug.
sender | UdpMediaClientSocket instance sending the event |
|
private |
Replaces connections with new connections by comparing their guid. If there is no connection with that guid, adds new connection.
newConnections | New connetions |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
UdpMediaDataReceived Hake_WPF.Connection.UdpMediaDataReceivedEvent |
|
private |
|
private |
|
private |
|
private |
|
private |
|
getset |
Gets and sets AsyncReceiver.
AssigmentUpdated Hake_WPF.Connection.AssigmentUpdatedEvent |