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.
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.
|
|
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.
Report a bug or request new features
© 2002