Skip to content

Tag: networking

TCP threaded server/client

I’m trying to make a threaded TCP server that accept multiple client. It’s only accepting one client. Any idea on how to make the server accepting multiple client? Here is what I tried so far: I changed the server code. I ran both the server and the client, but it seems that it’s only one th…

java.net.ConnectException: Connection refused

I’m trying to implement a TCP connection, everything works fine from the server’s side but when I run the client program (from client computer) I get the following error: I tried changing the socket number in case it was in use but to no avail, does anyone know what is causing this error & how…

SocketChannel: Single or multi , which is better?

SocketChannel is thread safe, so only one channel is need for communication between client and server. the channel served for read/write operations simultaneously But, if we using multi channels (more than one connections between the same client and server), will the io performance be improved ??? If can, why…

Asynchronous IO in Java?

What options for async io (socket-based) are there in java other then java.nio? Also does java.nio use threads in the backround (as I think .NET’s async-socket-library does, maybe it’s been changed) or is it “true” async io using a proper select call? Answer Java’s NIO package (a…