Originally posted by Stan James: How does the server tell the clients apart? Maybe C could connect to the server first with a request that says "SUBSCRIBE", something like ...
I'd be tempted to say C is not a client at all, but another server. Then we'd remove the "subscribe" message from the logic, and connect to C every time we want to send a message:
You wouldn't really need to connect to C inside the loop, but that would handle any broken connections, perhaps if C had to stop and restart.
Dear Stan James, I am happy to see your reply, thanks a lot. my problem is " 'N' number of clients can connect from Oralce(client program) to send message to server(ServerSocket, port 4747). But only my client(java program) has to connect server port and read message from that port. Rest of all clients have to send message to the port 4747. Can you pls give some tips to resolve this?
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop