2002-09-10 Michael Koch <konqueror@gmx.de>
* java/net/SocketImpl.java (connect): New method. (supportsUrgentData): New method. (sendUrgentData): New method. * java/net/PlainSocketImpl.java (connect): One new method and two new implementation. (sendUrgentData): New method. * java/natPlainSocketImpl.cc (connect): Arguments changed, added support for timeouts. (getOption): Another __java_boolean to jboolean. From-SVN: r57009
This commit is contained in:
parent
bfae804050
commit
a886956a40
4 changed files with 118 additions and 12 deletions
|
@ -119,6 +119,21 @@ public abstract class SocketImpl implements SocketOptions
|
|||
protected abstract void connect(InetAddress host, int port)
|
||||
throws IOException;
|
||||
|
||||
/**
|
||||
* Connects to the socket to the host specified in address. This
|
||||
* method blocks until successful connected or the timeout occurs.
|
||||
* A timeout of zero means no timout.
|
||||
*
|
||||
* @param address Data of remote host
|
||||
* @param timeout time to wait to stop connecting
|
||||
*
|
||||
* @exception IOException If an error occurs
|
||||
*
|
||||
* @since 1.4
|
||||
*/
|
||||
protected abstract void connect(SocketAddress address, int timeout)
|
||||
throws IOException;
|
||||
|
||||
/**
|
||||
* Binds to the specified port on the specified addr. Note that this addr
|
||||
* must represent a local IP address.
|
||||
|
@ -214,6 +229,31 @@ public abstract class SocketImpl implements SocketOptions
|
|||
*/
|
||||
protected int getPort() { return port; }
|
||||
|
||||
/**
|
||||
* Returns true or false when this socket supports sending urgent data
|
||||
* or not.
|
||||
*
|
||||
* @since 1.4
|
||||
*/
|
||||
protected boolean supportsUrgentData()
|
||||
{
|
||||
// This method has to be overwritten by socket classes that support
|
||||
// sending urgend data.
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends one byte of urgent data to the socket.
|
||||
*
|
||||
* @param data The byte to send, the low eight bits of it
|
||||
*
|
||||
* @exception IOException If an error occurs
|
||||
*
|
||||
* @since 1.4
|
||||
*/
|
||||
protected abstract void sendUrgentData(int data)
|
||||
throws IOException;
|
||||
|
||||
/**
|
||||
* Returns the local port this socket is bound to
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue