Nov 29, 2008

Listening the TCP PORT

How to Create

  1. The TcpListener class provides simple methods that listen for and accept incoming connection requests in blocking synchronous mode
  2. Use either a TcpClient or a Socket to connect with a TcpListenerCreate a TcpListener using an IPEndPoint
  3. The Start method to begin listening for incoming connection requests
  4. The Start will queue incoming connections until you either call the Stop method or it has queued MaxConnections
  5. Use either AcceptSocket or AcceptTcpClient to pull a connection from the incoming connection request queueCall the Stop method to close the TcpListener

Key To Remember

  • TcpListener.Start - Starts listening for incoming connection requests.
  • TcpListener.Stop - Stops and Closes the listener, which is listening for incoming connection requests. MaxConnections
  • IPEndPoint - Represents a network endpoint as an IP address and a port number.
  • LocalEndpoint - Gets the underlying EndPoint of the current TcpListener.
  • TcpClient and Socket - Provides set of methods and properties for network communications.
  • AcceptSocket, AcceptTcpClien - Accepts a pending connection request.

No comments: