|
.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 TCP Server class. Creates a TCP Server that listens for incoming connections. Uses the Network classes (IP Helper wrappers) do determine which interfaces to listen on.
Field Summary | |
---|---|
System.Net.IPAddress[] | addresses |
System.Net.IPEndPoint[] | endpoints |
NetSamples.Common.Net.TcpAsyncListener[] |
Listeners
The listeners. |
int | port |
bool | stop |
Constructor Summary | |
---|---|
TcpServer() Constructor. |
|
TcpServer(int port) Constructor. |
Property Summary | |
---|---|
System.Net.IPAddress[] |
Addresses
The set of IP Addresses that the service is listening on. |
System.Net.IPEndPoint[] |
EndPoints
The set of IP Addresses that the service is listening on. Only valid after the server has been started. |
int |
Port
The port that the server listens on. |
Method Summary | |
---|---|
void | BuildEndPoints() |
void |
OnAcceptSocket(System.IAsyncResult result) Internal event handler for the Accept event on the servers socket. Raises the Accept event in this class so that users of the server can handle incoming connections. Clients of this event are expected to close the socket when they are finished. |
void |
Start() Starts the server listening on the specified endpoint. |
void |
Stop() Stops the server. |
Methods inherited from class System.Object |
---|
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString |
Event Summary | |
---|---|
NetSamples.Common.Net.TcpAcceptEventHandler |
Accept
Accept event. |
Field Detail |
---|
private System.Net.IPAddress[] addresses
private System.Net.IPEndPoint[] endpoints
protected NetSamples.Common.Net.TcpAsyncListener[] Listeners
The listeners.
protected int port
private bool stop
Constructor Detail |
---|
public TcpServer()
Constructor.
public TcpServer(int port)
Constructor.
Property Detail |
---|
public System.Net.IPAddress[] Addresses
The set of IP Addresses that the service is listening on.
public System.Net.IPEndPoint[] EndPoints
The set of IP Addresses that the service is listening on. Only valid after the server has been started.
public int Port
The port that the server listens on.
Method Detail |
---|
private void BuildEndPoints()
protected void OnAcceptSocket(System.IAsyncResult result)
Internal event handler for the Accept event on the servers socket. Raises the Accept event in this class so that users of the server can handle incoming connections. Clients of this event are expected to close the socket when they are finished.
public void Start()
Starts the server listening on the specified endpoint.
public void Stop()
Stops the server.
Event Detail |
---|
public NetSamples.Common.Net.TcpAcceptEventHandler Accept
Accept event.
|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |