It's not a secret anymore!
The moose likes Sockets and Internet Protocols and the fly likes NIO Socket - connection problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "NIO Socket - connection problem" Watch "NIO Socket - connection problem" New topic
Author

NIO Socket - connection problem

biju thomas
Greenhorn

Joined: Jun 21, 2002
Posts: 1
Hi,
I am using the new NIO (of Java 1.4) for making a socket connection to a server. I do the following:
* Create a Selector (selector)
* Open a SocketChannel (sc)
* Connect to the Server using sc.connect()
* and if it returns false I register it with the selector for OP_CONNECT
* and when I recieve the CONNECT message, I use the sc.finishConnect()
This works fine, when the Server is running. But if the server is started after starting the client program, the program never recieves the OP_CONNECT message.
Does anyone know how to work arround this problem ?

Thanks,
biju.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NIO Socket - connection problem
 
Similar Threads
SocketChannel And Socket Shutdown/recycle
Can I use NIO api to read content from socket in client side?
Non-blocking sockets
Detecting connection request
nio selector