SocketImpl

public abstract class SocketImpl extends Object
implements SocketOptions

This class is the base of all streaming socket implementation classes. Streaming sockets are wrapped by two classes, ServerSocket and Socket at the server and client end of a connection. At the server, there are two types of sockets engaged in communication, the ServerSocket on a well known port (referred to as listener) used to establish a connection and the resulting Socket (referred to as host).

Inherited Constant Summary

Field Summary

protected InetAddress address The remote address this socket is connected to.
protected FileDescriptor fd The file descriptor of this socket.
protected int localport The local port this socket is connected to.
protected int port The remote port this socket is connected to.

Public Constructor Summary

Public Method Summary

String
toString()
Returns a string containing a concise, human-readable description of the socket.

Protected Method Summary

abstract void
accept(SocketImpl newSocket)
Waits for an incoming request and blocks until the connection is opened on the given socket.
abstract int
available()
Returns the available number of bytes which are readable from this socket without blocking.
abstract void
bind(InetAddress address, int port)
Binds this socket to the specified local host address and port number.
abstract void
close()
Closes this socket.
abstract void
connect(InetAddress address, int port)
Connects this socket to the specified remote host address and port number.
abstract void
connect(SocketAddress remoteAddr, int timeout)
Connects this socket to the remote host address and port number specified by the SocketAddress object with the given timeout.
abstract void
connect(String host, int port)
Connects this socket to the specified remote host and port number.
abstract void
create(boolean isStreaming)
Creates a new unconnected socket.
FileDescriptor
getFileDescriptor()
Gets the file descriptor of this socket.
InetAddress
getInetAddress()
Gets the remote address this socket is connected to.
abstract InputStream
getInputStream()
Gets the input stream of this socket.
int
getLocalPort()
Gets the local port number of this socket.
abstract OutputStream
getOutputStream()
Gets the output stream of this socket.
int
getPort()
Gets the remote port number of this socket.
abstract void
listen(int backlog)
Listens for connection requests on this streaming socket.
abstract void
sendUrgentData(int value)
Sends the single byte of urgent data on the socket.
void
setPerformancePreferences(int connectionTime, int latency, int bandwidth)
Sets performance preference for connection time, latency and bandwidth.
void
shutdownInput()
Closes the input channel of this socket.
void
shutdownOutput()
Closes the output channel of this socket.
boolean
supportsUrgentData()
Returns whether the socket supports urgent data or not.

Inherited Method Summary