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

Class TSocketPlain

Instances of TSocketPlain are used as client sockets to connect to remote servers. After the connection is established the methods getInput and getOutput can be used to retrieve the streams associated with the socket.

Method Summary
close
         Closes the socket.
connect host port
         Connects the socket to a remote server.
getInput
         Fetches the input stream associated with the socket.
getOutput
         Fetches the output stream associated with the socket.

Method Detail

close

TSocketPlain close

Closes the socket.

Returns:
A reference to the object it was called for.

Closing the socket automatically closes the input and output streams that were associated with it.

connect

TSocketPlain connect host port

Connects the socket to a remote server.

Parameters:
host - A string representing the name of the remote server to connect to.
port - An integer representing the port number on the remote server to connect to.
Returns:
A reference to the object it was called for.

If the connection can not be successfully established then a runtime error will occur.

getInput

TSocketPlain getInput

Fetches the input stream associated with the socket.

Returns:
A reference to a TInput instance.

If the socket has not yet been opened then the TInput stream that is returned will be closed and can not be used. As soon as the socket is successfully opened the TInput will also be automatically opened and associated with the socket input stream.

getOutput

TSocketPlain getOutput

Fetches the output stream associated with the socket.

Returns:
A reference to a TOutput instance.

If the socket has not yet been opened then the TOutput stream that is returned will be closed and can not be used. As soon as the socket is successfully opened the TOutput will also be automatically opened and associated with the socket output stream.


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