2

I'm using client-server mechanism inside my app to transport internal data. One of server parts should be designed to serve one request at time, no threads, no backlogs. I found weird functionality then using:

serverport = new ServerSocket(port, 1, InetAddress.getLoopbackAddress());

This one continue to receive incoming connection even after one is already backlogged? Any suggestions how it's possible, and how may I workaround the issue?

Amit Verma
  • 40,709
  • 21
  • 93
  • 115
LifeOnNet
  • 107
  • 2
  • 13

1 Answers1

1

As it says in the Javadoc:

The backlog argument is the requested maximum number of pending connections on the socket. Its exact semantics are implementation specific. In particular, an implementation may impose a maximum length or may choose to ignore the parameter altogther. The value provided should be greater than 0. If it is less than or equal to 0, then an implementation specific default will be used.

user207421
  • 305,947
  • 44
  • 307
  • 483