1 // Class to identify socket option constants.
6 public class GetSocketOptionInfo
extends Socket
implements SocketImplFactory
12 return(new PlainSocketImpl());
16 main(String
[] argv
) throws IOException
18 Socket
.setSocketImplFactory(new GetSocketOptionInfo());
20 Socket s
= new Socket();
22 System
.err
.println("Setting TCP_NODELAY on");
23 s
.setTcpNoDelay(true);
24 System
.err
.println("Setting TCP_NODELAY off");
25 s
.setTcpNoDelay(false);
27 System
.err
.println("Setting SO_LINGER on");
28 s
.setSoLinger(true, 10);
29 System
.err
.println("Setting SO_LINGER off");
30 s
.setSoLinger(false, 1);
32 System
.err
.println("Setting SO_TIMEOUT to 15");
34 System
.err
.println("Setting SO_TIMEOUT to 0");