This week's book giveaways are in the Jython/Python and Object-Oriented programming forums. We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line! See this thread and this one for details.
Hi, all, I have a design. But I am not sure if it is correct. I have two computers, each runing with SERVER Socket to receive incoming request. After it gets message, it will open another Client socket in another port to outside computer. The tricky is , EACH computer is runing in SERVER socket mode. not the client-server mode. This design will work? Thanks. Edward
Neither computers nor programs have a "server mode", per se. Many programs act as both network servers and network clients. The only complication is that you'll most likely want to use a dedicated thread for listening on the ServerSocket, so that the client activities don't block the server.
What you described sounds fine. A program opens a ServerSocket that will accept connections from clients. When a client sends a message, the program acts as a client by opening a connection to another server. Happens all the time.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad: