WebRTC Network
0.96
|
Contains information about events received by the network. More...
Public Member Functions | |
byte[] | GetDataAsByteArray () |
NetworkEvent (NetEventType t) | |
Creates a new network event of a certain type setting connection id to invalid and data to null. More... | |
NetworkEvent (NetEventType t, ConnectionId conId, object dt) | |
Creates a network event with the given content More... | |
override string | ToString () |
Converts the event to string. Use for debugging only. More... | |
Static Public Member Functions | |
static NetworkEvent | FromByteArray (byte[] arr) |
static byte[] | ToByteArray (NetworkEvent evt) |
Properties | |
NetEventType | Type [get] |
Returns the type of the message. More... | |
ConnectionId | ConnectionId [get] |
Returns the related connection id or ConnecitonId.Invalid if there is none. More... | |
object | RawData [get] |
Returns an object belonging to the event. This can be a MessageDataBuffer containing a byte array or a string. More... | |
MessageDataBuffer | MessageData [get] |
Returns the content of the messages if the event type is UnreliableMessageReceived or ReliableMessageReceived. More... | |
string | Info [get] |
Contains additional information or null Only used so far for NetEventType.ServerInitialized to return the servers address information. More... | |
Contains information about events received by the network.
The type of the network event decides the content it can contain.
Most important are:
UnreliableMessageReceived / ReliableMessageReceived: A new message was received. The property MessageData will return a buffer + byte array containing the data received.
ServerInitialized: A call to StartServer was successful. The Info property will return the address the server can be accessed by.
Byn.Net.NetworkEvent.NetworkEvent | ( | NetEventType | t | ) |
Creates a new network event of a certain type setting connection id to invalid and data to null.
Internal only. Do not use.
t | The type of this event |
Byn.Net.NetworkEvent.NetworkEvent | ( | NetEventType | t, |
ConnectionId | conId, | ||
object | dt | ||
) |
Creates a network event with the given content
Internal only. Do not use.
t | Type name |
conId | ConnectionId the event is from / relates to |
dt | Data. String or MessageDataBuffer |
override string Byn.Net.NetworkEvent.ToString | ( | ) |
Converts the event to string. Use for debugging only.
|
get |
Returns the related connection id or ConnecitonId.Invalid if there is none.
|
get |
Contains additional information or null Only used so far for NetEventType.ServerInitialized to return the servers address information.
|
get |
Returns the content of the messages if the event type is UnreliableMessageReceived or ReliableMessageReceived.
null for all other message types.
|
get |
Returns an object belonging to the event. This can be a MessageDataBuffer containing a byte array or a string.
|
get |
Returns the type of the message.