WebRTC Network  0.96
Public Member Functions | Static Public Member Functions | Properties | List of all members
Byn.Net.NetworkEvent Struct Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Parameters
tThe 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.

Parameters
tType name
conIdConnectionId the event is from / relates to
dtData. String or MessageDataBuffer

Member Function Documentation

override string Byn.Net.NetworkEvent.ToString ( )

Converts the event to string. Use for debugging only.

Returns
A string representation of the network event.

Property Documentation

ConnectionId Byn.Net.NetworkEvent.ConnectionId
get

Returns the related connection id or ConnecitonId.Invalid if there is none.

string Byn.Net.NetworkEvent.Info
get

Contains additional information or null Only used so far for NetEventType.ServerInitialized to return the servers address information.

MessageDataBuffer Byn.Net.NetworkEvent.MessageData
get

Returns the content of the messages if the event type is UnreliableMessageReceived or ReliableMessageReceived.

null for all other message types.

object Byn.Net.NetworkEvent.RawData
get

Returns an object belonging to the event. This can be a MessageDataBuffer containing a byte array or a string.

NetEventType Byn.Net.NetworkEvent.Type
get

Returns the type of the message.


The documentation for this struct was generated from the following file: