|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.net.SocketImpl
|
+--com.act365.net.GeneralSocketImpl
GeneralDatagramSocketImpl extends java.net.SocketImpl
and provides native implementations of all of its abstract methods. The
class remains abstract because it leaves its create() method
undefined - it is up to subclasses to specify the parameters that will
be used to create the underlying socket. The native code calls into the
local Berkeley sockets implementation.
| Fields inherited from interface java.net.SocketOptions |
IP_MULTICAST_IF, SO_BINDADDR, SO_KEEPALIVE, SO_LINGER, SO_RCVBUF, SO_REUSEADDR, SO_SNDBUF, SO_TIMEOUT, TCP_NODELAY |
| Constructor Summary | |
GeneralSocketImpl()
|
|
| Method Summary | |
void |
accept(java.net.SocketImpl newSocket)
Accepts a connection request for this socket. |
int |
available()
available() isn't supported. |
void |
bind(java.net.InetAddress inetAddress,
int port)
Binds this socket to the local port. |
void |
close()
Closes this socket. |
void |
connect(java.net.InetAddress dst,
int remotePort)
Connects this socket to a given destination. |
void |
connect(java.net.SocketAddress address,
int timeout)
Connects to the specified host. |
void |
connect(java.lang.String hostName,
int port)
Connects this socket to a named host. |
void |
create(int socketType,
int protocol)
Creates a new unconnected TCP socket. |
static java.net.InetAddress |
createInetAddress(int family,
byte[] ipAddress)
Creates a java.net.InetAddress object with a given IP address. |
java.io.InputStream |
getInputStream()
Gets the input stream. |
java.lang.Object |
getOption(int optID)
Gets the value of a socket option. |
java.io.OutputStream |
getOutputStream()
Gets the output stream. |
static int |
getSocketDescriptor(java.io.FileDescriptor fd)
Gets the socket descriptor from a java.io.FileDescriptor object. |
void |
listen(int backlog)
Listens for connection requests on this socket. |
void |
sendUrgentData(int data)
Urgent data isn't supported. |
void |
setOption(int optID,
java.lang.Object value)
Sets the value of a socket option.The value has to be an Integer object. |
static void |
setSocketDescriptor(java.io.FileDescriptor fd,
int sd)
Sets the socket descriptor for a java.io.FileDescriptor object. |
| Methods inherited from class java.net.SocketImpl |
toString |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public GeneralSocketImpl()
| Method Detail |
public void create(int socketType,
int protocol)
throws java.io.IOException
socketType - the socket type as defined in SocketConstants e.g. SOCK_RAWprotocol - the protocol as defined in SocketConstants e.g. IPPROTO_UDPSocketConstants
public void bind(java.net.InetAddress inetAddress,
int port)
throws java.io.IOException
inetAddress - local IP addressport - number of the local port
public void connect(java.lang.String hostName,
int port)
throws java.io.IOException
hostName - name of the remote hostport - port number on the remote host
public void connect(java.net.InetAddress dst,
int remotePort)
throws java.io.IOException
dst - address of the remote hostremotePort - port number on the remote host
public void connect(java.net.SocketAddress address,
int timeout)
throws java.io.IOException
public void listen(int backlog)
throws java.io.IOException
backlog - maxmimum number of pending requests to be serviced simultaneously
public void accept(java.net.SocketImpl newSocket)
throws java.io.IOException
newSocket - socket to be populated with the details of the remote client
public void close()
throws java.io.IOException
public static int getSocketDescriptor(java.io.FileDescriptor fd)
java.io.FileDescriptor object.
NB Java provides no public access to the value of the descriptor so
it has to be extracted using native code.
public static void setSocketDescriptor(java.io.FileDescriptor fd,
int sd)
java.io.FileDescriptor object.
NB Java provides no public access to the descriptor so its value has to
be set using native code.
public static java.net.InetAddress createInetAddress(int family,
byte[] ipAddress)
java.net.InetAddress object with a given IP address.family - the socket family - normally SocketConstants.AF_INETipAddress - the IP address e.g. new byte[] { 127, 0, 0, 1 }
public void setOption(int optID,
java.lang.Object value)
throws java.net.SocketException
Integer object.setOption in class java.net.SocketImploptID - option as defined in java.net.SocketConstantsvalue - an Integer object that wraps the new value
public java.lang.Object getOption(int optID)
throws java.net.SocketException
Integer object.getOption in class java.net.SocketImploptID - option as defined in java.net.SocketConstants
public java.io.OutputStream getOutputStream()
throws java.io.IOException
public java.io.InputStream getInputStream()
throws java.io.IOException
public int available()
throws java.io.IOException
available() isn't supported.
public void sendUrgentData(int data)
throws java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||