Overview Module Function Class Tea 3.1.0 Reference Documentation
© 2002 PDM&FC

Class TServerSocket

A TServerSocket is used as a server socket. It can listen for incoming connections in a given TCP/IP port. Each TServerSocket is bound to a port number passed to its constructor. The accept method is used to receive an incoming connection. This method returns a TSocket instance that can be used to read to and write from the connection with the client side of the socket.

Method Summary
accept
         Listens for incoming client connections on the port the server socket is bound to.
close
         Closes the server socket.
constructor port
         Initializes the server socket by specifying the port it will be bound to.

Method Detail

accept

TServerSocket accept

Listens for incoming client connections on the port the server socket is bound to.

Returns:
An instance of TSocket associated with the connection that was accepted.

This method blocks until a connection is a client initiated connection is established.

close

TServerSocket close

Closes the server socket.

After the socket is closed it can no longer accept new connections.

constructor

TServerSocket constructor port

Initializes the server socket by specifying the port it will be bound to.

Parameters:
port - An integer representing the TCP/IP port number the server socket will be bound to.



Overview Module Function Class Tea 3.1.0 Reference Documentation
© 2002 PDM&FC
Report a bug or request new features
© 2002