Initial revision
From-SVN: r102074
This commit is contained in:
parent
6f4434b39b
commit
f911ba985a
4557 changed files with 1000262 additions and 0 deletions
39
libjava/classpath/compat/java.net/GetSocketOptionInfo.java
Normal file
39
libjava/classpath/compat/java.net/GetSocketOptionInfo.java
Normal file
|
@ -0,0 +1,39 @@
|
|||
// Class to identify socket option constants.
|
||||
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
|
||||
public class GetSocketOptionInfo extends Socket implements SocketImplFactory
|
||||
{
|
||||
|
||||
public SocketImpl
|
||||
createSocketImpl()
|
||||
{
|
||||
return(new PlainSocketImpl());
|
||||
}
|
||||
|
||||
public static void
|
||||
main(String[] argv) throws IOException
|
||||
{
|
||||
Socket.setSocketImplFactory(new GetSocketOptionInfo());
|
||||
|
||||
Socket s = new Socket();
|
||||
|
||||
System.err.println("Setting TCP_NODELAY on");
|
||||
s.setTcpNoDelay(true);
|
||||
System.err.println("Setting TCP_NODELAY off");
|
||||
s.setTcpNoDelay(false);
|
||||
|
||||
System.err.println("Setting SO_LINGER on");
|
||||
s.setSoLinger(true, 10);
|
||||
System.err.println("Setting SO_LINGER off");
|
||||
s.setSoLinger(false, 1);
|
||||
|
||||
System.err.println("Setting SO_TIMEOUT to 15");
|
||||
s.setSoTimeout(15);
|
||||
System.err.println("Setting SO_TIMEOUT to 0");
|
||||
s.setSoTimeout(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue