SocketChannelCreatepublic class SocketChannelCreate extends Object Test creation of SocketChannels.
Created and tested: Dec 31, 2001 |
Methods Summary |
---|
public static void | main(java.lang.String[] argv)
SocketChannel sc;
Socket sock;
sc = SocketChannel.open();
sock = sc.socket();
print ("SocketChannel.open()", sc, sock);
sock = new Socket();
sc = sock.getChannel();
print ("SocketChannel.open()", sc, sock);
| private static void | print(java.lang.String msg, java.nio.channels.SocketChannel sc, java.net.Socket sock)
boolean hasChannel = (sc != null);
boolean hasSocket = (sock != null);
System.out.println (msg + ": channel=" + hasChannel
+ ", socket=" + hasSocket);
|
|