problem with SocketServer.accept()

Hi i have a little problem,

I’m creating the socketserver, no problem with that
myserver = new ServerSocket( 33522, 100 );

but after when i ask him to accept() connection, it froze my application
connexion = myserver.accept();

Tell me where i m wrong

Thanks
Phil

Phil,

You should have the ServerSocket.accept() in a seperate thread, as it blocks until a socket is accepted… so no, you’re program didn’t hang it’s just waiting for a connection.

Incidentally, you should do your i/o with the socket once a connection is made in a seperate thread as well.

Regards,

Bill