2002-09-21 Michael Koch <konqueror@gmx.de>

* java/net/Socket.java
	(sendUrgentData): New method.
	(getChannel): New method.
	* java/net/ServerSocket.java
	(getChannel): New method.
	(isBound): New method.
	* java/net/DatagramSocket.java
	(DatagramSocket): Two new methods.
	(bind): New method.
	(getChannel): New method.
	(isBound): New method.
	(send): Added newline to to make shorter lines.
	* java/net/PlainDatagramSocketImpl.java
	(mcastGrp): Added argument.
	(join): Use new mcastGrp.
	(leave): Use new mcastGrp.
	(joinGroup): New method.
	(leaveGroup): New method.
	* java/net/natPlainDatagramSocketImpl.cc
	(mcastGrp): Added argument, no yet really implemented.
	(getOption): Added newline for shorter lines.
	* java/net/natPlainSocketImpl.cc
	(read, setOption, getOption): Added newline for shorter lines.

From-SVN: r57380
This commit is contained in:
Michael Koch 2002-09-21 06:59:20 +00:00 committed by Michael Koch
parent 84d7dd4a53
commit be362a0d5b
7 changed files with 205 additions and 13 deletions

View file

@ -38,6 +38,7 @@ exception statement from your version. */
package java.net;
import java.io.*;
import java.nio.channels.SocketChannel;
/* Written using on-line Java Platform 1.2 API Specification.
* Status: I believe all methods are implemented.
@ -78,6 +79,8 @@ public class Socket
*/
SocketImpl impl;
SocketChannel ch; // this field must have been set if created by SocketChannel
// Constructors
/**
@ -524,6 +527,21 @@ public class Socket
return -1;
}
/**
* Sends urgent data through the socket
*
* @param data The data to send.
* Only the lowest eight bits of data are sent
*
* @exception IOException If an error occurs
*
* @since 1.4
*/
public void sendUrgentData (int data) throws IOException
{
impl.sendUrgentData (data);
}
/**
* Enables/disables the SO_OOBINLINE option
*
@ -819,4 +837,14 @@ public class Socket
if (impl != null)
impl.shutdownOutput();
}
/**
* Returns the socket channel associated with this socket.
*
* It returns null if no associated socket exists.
*/
public SocketChannel getChannel()
{
return ch;
}
}