System [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 1.0.3300.0 1.0.5000.0 2.0.0.0 4.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.Object

The class provides simple methods that listen for and accept incoming connection requests in blocking synchronous mode. You can use either a or a to connect with a . Create a using an , a Local IP address and port number, or just a port number. Specify for the local IP address and 0 for the local port number if you want the underlying service provider to assign those values for you. If you choose to do this, you can use the property to identify the assigned information, after the socket has connected.

Use the method to begin listening for incoming connection requests. will queue incoming connections until you either call the method or it has queued . Use either or to pull a connection from the incoming connection request queue. These two methods will block. If you want to avoid blocking, you can use the method first to determine if connection requests are available in the queue.

Call the method to close the .

The method does not close any accepted connections. You are responsible for closing these separately.

Listens for connections from TCP network clients.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Obsolete("Use TcpListener (IPAddress address, int port) instead")

  This constructor is obsolete. Use the or constructors.

  This constructor allows you to specify the port number on which to listen for incoming connection attempts. With this constructor, the underlying service provider assigns the most appropriate network address. If you do not care which local port is used, you can specify 0 for the port number. In this case, the service provider will assign an available port number between 1024 and 5000. If you use this approach, you can discover what local network address and port number has been assigned by using the property.

  Call the method to begin listening for incoming connection attempts.

  Initializes a new instance of the class that listens on the specified port.

  The port on which to listen for incoming connection attempts.
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  This constructor allows you to specify the local IP address and port number on which to listen for incoming connection attempts. Before using this constructor, you must create an using the desired local IP address and port number. Pass this to the constructor as the parameter.

  If you do not care which local address is assigned, you can create an using as the address parameter, and the underlying service provider will assign the most appropriate network address. This might help simplify your application if you have multiple network interfaces. If you do not care which local port is used, you can create an using 0 for the port number. In this case, the service provider will assign an available port number between 1024 and 5000. If you use this approach, you can discover what local network address and port number has been assigned by using the property.

  Call the method to begin listening for incoming connection attempts.

  This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].

  Initializes a new instance of the class with the specified local endpoint.

  An that represents the local endpoint to which to bind the listener .
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  This constructor allows you to specify the local IP address and port number on which to listen for incoming connection attempts. Before calling this constructor you must first create an using the desired local address. Pass this to the constructor as the parameter. If you do not care which local address is assigned, specify for the parameter, and the underlying service provider will assign the most appropriate network address. This might help simplify your application if you have multiple network interfaces. If you do not care which local port is used, you can specify 0 for the port number. In this case, the service provider will assign an available port number between 1024 and 5000. If you use this approach, you can discover what local network address and port number has been assigned by using the property.

  Call the method to begin listening for incoming connection attempts.

  This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].

  Initializes a new instance of the class that listens for incoming connection attempts on the specified local IP address and port number.

  An that represents the local IP address.
  The port on which to listen for incoming connection attempts.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Net.Sockets.Socket

  is a blocking method that returns a that you can use to send and receive data. If you want to avoid blocking, use the method to determine if connection requests are available in the incoming connection queue.

  The returned is initialized with the IP address and port number of the remote host. You can use any of the and methods available in the class to communicate with the remote host. When you are finished using the , be sure to call its method. If your application is relatively simple, consider using the method rather than the method. provides you with simple methods for sending and receiving data over a network in blocking synchronous mode.

  This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].

  Accepts a pending connection request.

  A used to send and receive data.

- Method
  4.0.0.0
  System.Threading.Tasks.Task<System.Net.Sockets.Socket>

  This operation will not block. The returned object will complete after the socket connection has been accepted.

  The returned in is initialized with the IP address and port number of the remote host. You can use any of the and methods available in the class to communicate with the remote host. When you are finished using the , be sure to call its method. If your application is relatively simple, consider using the method rather than the method. provides you with simple methods for sending and receiving data over a network in blocking synchronous mode.

  This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].

  Accepts a pending connection request as an asynchronous operation.

  Returns

  The task object representing the asynchronous operation. The property on the task object returns a used to send and receive data.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Net.Sockets.TcpClient

  is a blocking method that returns a that you can use to send and receive data. Use the method to determine if connection requests are available in the incoming connection queue if you want to avoid blocking.

  Use the method to obtain the underlying of the returned . The will provide you with methods for sending and receiving with the remote host. When you are through with the , be sure to call its method. If you want greater flexibility than a offers, consider using .

  This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].

  Accepts a pending connection request.

  A used to send and receive data.

- Method
  4.0.0.0
  System.Threading.Tasks.Task<System.Net.Sockets.TcpClient>

  This operation will not block. The returned object will complete after the TCP connection has been accepted.

  Use the method to obtain the underlying of the returned in the . The will provide you with methods for sending and receiving with the remote host. When you are through with the , be sure to call its method. If you want greater flexibility than a offers, consider using or .

  This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].

  Accepts a pending connection request as an asynchronous operation.

  Returns

  The task object representing the asynchronous operation. The property on the task object returns a used to send and receive data.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added: an object of type 'bool'

  Classes deriving from can use this property to determine if the is currently listening for incoming connection attempts. The property can be used to avoid redundant attempts.

  Gets a value that indicates whether is actively listening for client connections.

- Method
  2.0.0.0
  4.0.0.0
  System.IAsyncResult `` ``

  The asynchronous operation must be completed by calling the method. Typically, the method is invoked by the delegate.

  This method does not block until the operation completes. To block until the operation completes, use the method.

  For detailed information about using the asynchronous programming model, see Asynchronous Programming Overview.

  You can call the property of the returned to identify the remote host's network address and port number.

  If you receive a , use the property to obtain the specific error code and refer to the Windows Sockets version 2 API error code documentation in the MSDN library at http://msdn.microsoft.com/library/ for a detailed description of the error.

  This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].

  Begins an asynchronous operation to accept an incoming connection attempt.

  An that references the asynchronous creation of the .

  An delegate that references the method to invoke when the operation is complete. A user-defined object containing information about the accept operation. This object is passed to the delegate when the operation is complete.
- Method
  2.0.0.0
  4.0.0.0
  System.IAsyncResult `` ``

  The asynchronous operation must be completed by calling the method. Typically, the method is invoked by the delegate.

  This method does not block until the operation completes. To block until the operation completes, use the method.

  For detailed information about using the asynchronous programming model, see Asynchronous Programming Overview.

  If you receive a , use the property to obtain the specific error code and refer to the Windows Sockets version 2 API error code documentation in the MSDN library at http://msdn.microsoft.com/library/ for a detailed description of the error.

  This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].

  Begins an asynchronous operation to accept an incoming connection attempt.

  An that references the asynchronous creation of the .

  An delegate that references the method to invoke when the operation is complete. A user-defined object containing information about the accept operation. This object is passed to the delegate when the operation is complete.
- Method
  2.0.0.0
  4.0.0.0
  System.Net.Sockets.Socket ``

  This method blocks until the operation is complete. To perform this operation synchronously, use the method.

  You can call the property of the returned to identify the remote host's network address and port number.

  If you receive a , use the property to obtain the specific error code and refer to the Windows Sockets version 2 API error code documentation in the MSDN library at http://msdn.microsoft.com/library/ for a detailed description of the error.

  This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].

  Asynchronously accepts an incoming connection attempt and creates a new to handle remote host communication.

  A .

  The used to send and receive data.

  An returned by a call to the method.
- Method
  2.0.0.0
  4.0.0.0
  System.Net.Sockets.TcpClient ``

  This method blocks until the operation is complete. To perform this operation synchronously, use the method.

  You can call the property of the underlying socket () to identify the remote host's network address and port number.

  If you receive a , use the property to obtain the specific error code and refer to the Windows Sockets version 2 API error code documentation in the MSDN library at http://msdn.microsoft.com/library/ for a detailed description of the error.

  This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].

  Asynchronously accepts an incoming connection attempt and creates a new to handle remote host communication.

  A .

  The used to send and receive data.

  An returned by a call to the method.
- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  By default, multiple listeners can listen to a specific port. However, only one of the listeners can perform operations on the network traffic sent to the port. If more than one listener attempts to bind to a particular port, then the one with the more specific IP address handles the network traffic sent to that port. You can use the property to prevent multiple listeners from listening to a specific port.

  Set this property before calling , or call the method and then set this property.

  Gets or sets a value that specifies whether the allows only one underlying socket to listen to a specific port.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  The class finalizer free resources associated with the instance.

  Frees resources used by the class.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Net.EndPoint To be added: an object of type 'Net.EndPoint'

  You can use the property to identify the local network interface and port number being used to listen for incoming client connection requests, after a socket connection has been made. You must first cast this to an . You can then call the property to retrieve the local IP address, and the property to retrieve the local port number.

  Gets the underlying of the current .

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean

  This non-blocking method determines if there are any pending connection requests. Because the and methods block execution until the method has queued an incoming connection request, the method can be used to determine if connections are available before attempting to accept them.

  Determines if there are pending connection requests.

  true if connections are pending; otherwise, false.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Net.Sockets.Socket To be added: an object of type 'Socket'

  creates a to listen for incoming client connection requests. Classes deriving from can use this property to get this . Use the underlying returned by the property if you require access beyond that which provides.

  The property only returns the used to listen for incoming client connection requests. Use the method to accept a pending connection request and obtain a for sending and receiving data. You can also use the method to accept a pending connection request and obtain a for sending and receiving data.

  Gets the underlying network .

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  The method initializes the underlying , binds it to a local endpoint, and listens for incoming connection attempts. If a connection request is received, the method will queue the request and continue listening for additional requests until you call the method. If receives a connection request after it has already queued the maximum number of connections, it will throw a on the client.

  To remove a connection from the incoming connection queue, use either the method or the method. The method will remove a connection from the queue and return a that you can use to send and receive data. The method will return a that you can use to do the same. If your application only requires synchronous I/O, use . For more detailed behavioral control, use . Both of these methods block until a connection request is available in the queue.

  Use the method to close the and stop listening. You are responsible for closing your accepted connections separately.

  This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].

  Starts listening for incoming connection requests.

- Method
  2.0.0.0
  4.0.0.0
  System.Void ``

  The method initializes the underlying , binds it to a local endpoint, and listens for incoming connection attempts. If a connection request is received, will queue the request and continue listening for additional requests until you call the method. If receives a connection request after it has already queued the maximum number of connections it will throw a on the client.

  To remove a connection from the incoming connection queue, use either the method or the method. The method will remove a connection from the queue and return a that you can use to send and receive data. The method will return a that you can use to do the same. If your application only requires synchronous I/O, use the . For more detailed behavioral control, use method. Both of these methods block until a connection request is available in the queue.

  Use the method to close the and stop listening. You are responsible for closing your accepted connections separately.

  Use the property to obtain the specific error code and refer to the Windows Sockets version 2 API error code documentation in the MSDN library at http://msdn.microsoft.com/library/ for a detailed description of the error.

  This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].

  Starts listening for incoming connection requests with a maximum number of pending connection.

  The maximum length of the pending connections queue.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  closes the listener. Any unaccepted connection requests in the queue will be lost. Remote hosts waiting for a connection to be accepted will throw a . You are responsible for closing your accepted connections separately.

  This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].

  Closes the listener.