Skip to content
Advertisement

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 thread is working. Should I

Is binding to 0.0.0.0 in Java guaranteed to bind to all network interfaces?

I’ve found empirically that binds to all network interfaces on the current computer (instead of just localhost – 127.0.0.1 or the hostname), but I have not been able to locate the documentation which says that this is guaranteed. Question: Where is it defined that binding to 0.0.0.0 in Java will always bind to all network interfaces? Answer Using 0.0.0.0 will

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 to fix it. The Server

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?????? any answer is welcome. Suppose a cache client, which poll data

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 (as of Java6), provides support for non-blocking I/O only, via Selectors. Java7 is hopefully

Advertisement