|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |
A UDP Listener
Field Summary | |
---|---|
System.Net.IPAddress | mcastaddress |
NetSamples.Common.Net.UdpListener.ReceiveDelegate | receiveDelegate |
NetSamples.Common.Net.UdpListener.SendDelegate | sendDelegate |
System.Net.Sockets.Socket | sock |
bool | stopping |
Constructor Summary | |
---|---|
UdpListener() Constructor. |
Property Summary | |
---|---|
System.Net.IPEndPoint |
LocalEndPoint
Returns the local endpoint for the server. |
System.Net.IPAddress |
MulticastAddress
Returns the current multicast group address or sets a new one. |
Method Summary | |
---|---|
System.IAsyncResult |
BeginReceive(System.AsyncCallback callback, object state) Starts an asynchronous receive operation |
void |
BeginReceive() Starts an asynchronous receive operation (private) |
System.IAsyncResult |
BeginSend(NetSamples.Common.Net.Datagram datagram, System.AsyncCallback callback, object state) Starts an asynchronous send operation |
void |
Bind(System.Net.IPEndPoint endpoint) Bind to the specified endpoint. |
void |
BindReuse(System.Net.IPEndPoint endpoint) Bind to the specified endpoint. |
void |
DropMulticastGroup(System.Net.IPAddress multicastgroup) Removes the listener from the specified multicast group. |
NetSamples.Common.Net.Datagram |
EndReceive(System.IAsyncResult ar) Ends an asynchronous receive operation. |
void |
EndSend(System.IAsyncResult ar) Ends an asynchronouse send operation |
void |
Finalize() Finalizer |
void |
JoinMulticastGroup(System.Net.IPAddress multicastgroup) Adds the listener to the specified multicast group. |
void |
OnReceive(System.IAsyncResult ar) Internal receive handler: this handles the event from the MessageReader instance in the server and forwards it on to any objects attached to the MessageReceived event. |
NetSamples.Common.Net.Datagram |
Receive() Attempts to receive a datagram. This call blocks until the receive completes. |
void |
Send(NetSamples.Common.Net.Datagram datagram) Sends the specified message to the specified endpoint. For connected TCP sockets, the endpoint may be specified as null. Connected UDP sockets are not supported at this time. |
void |
SetMulticastTtl(int ttl) Sets the Multicast Time to Live for the socket. |
void |
Start() Starts the server. When started, the UDPListener issues a BeginReceive to start receiving packets. Whenever a packet is received, the Received event is fired. |
void |
Stop() Stops the server. |
Methods inherited from class System.Object |
---|
Equals, GetHashCode, GetType, MemberwiseClone, ToString |
Event Summary | |
---|---|
NetSamples.Common.Net.DatagramEventHandler |
Received
The MessageReceived event is raised when a message is received by the server. |
Field Detail |
---|
protected System.Net.IPAddress mcastaddress
private NetSamples.Common.Net.UdpListener.ReceiveDelegate receiveDelegate
private NetSamples.Common.Net.UdpListener.SendDelegate sendDelegate
protected System.Net.Sockets.Socket sock
protected bool stopping
Constructor Detail |
---|
public UdpListener()
Constructor.
Property Detail |
---|
public System.Net.IPEndPoint LocalEndPoint
Returns the local endpoint for the server.
public System.Net.IPAddress MulticastAddress
Returns the current multicast group address or sets a new one.
The UDPListener only supports membership of a singe multicast group at any point in time.
Method Detail |
---|
public System.IAsyncResult BeginReceive(System.AsyncCallback callback, object state)
Starts an asynchronous receive operation
protected void BeginReceive()
Starts an asynchronous receive operation (private)
public System.IAsyncResult BeginSend(NetSamples.Common.Net.Datagram datagram, System.AsyncCallback callback, object state)
Starts an asynchronous send operation
public void Bind(System.Net.IPEndPoint endpoint)
Bind to the specified endpoint.
public void BindReuse(System.Net.IPEndPoint endpoint)
Bind to the specified endpoint.
public void DropMulticastGroup(System.Net.IPAddress multicastgroup)
Removes the listener from the specified multicast group.
public NetSamples.Common.Net.Datagram EndReceive(System.IAsyncResult ar)
Ends an asynchronous receive operation.
public void EndSend(System.IAsyncResult ar)
Ends an asynchronouse send operation
protected void Finalize()
Finalizer
public void JoinMulticastGroup(System.Net.IPAddress multicastgroup)
Adds the listener to the specified multicast group.
protected void OnReceive(System.IAsyncResult ar)
Internal receive handler: this handles the event from the MessageReader instance in the server and forwards it on to any objects attached to the MessageReceived event.
public NetSamples.Common.Net.Datagram Receive()
Attempts to receive a datagram. This call blocks until the receive completes.
public void Send(NetSamples.Common.Net.Datagram datagram)
Sends the specified message to the specified endpoint. For connected TCP sockets, the endpoint may be specified as null. Connected UDP sockets are not supported at this time.
public void SetMulticastTtl(int ttl)
Sets the Multicast Time to Live for the socket.
public void Start()
Starts the server. When started, the UDPListener issues a BeginReceive to start receiving packets. Whenever a packet is received, the Received event is fired.
public void Stop()
Stops the server.
Event Detail |
---|
public NetSamples.Common.Net.DatagramEventHandler Received
The MessageReceived event is raised when a message is received by the server.
|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |