Forums Register Login

Wud it be possible to Open a ServerSocket from one program and Close from another program

+Pie Number of slices to send: Send
Hi,

Wud it be possible to Open a ServerSocket from one program and Close from another program

Thanks,
Murali
+Pie Number of slices to send: Send
Hi and welcome to the JavaRanch.

What you could do is open a connection from A to B, send a close command, then B closes it's connection with A and it's (other) ServerSocket.
That is probably the easiest way to accomplish that.
+Pie Number of slices to send: Send
Not directly, I don't think. However, you can make a connection with a regular Socket through a ServerSocket, and then send a simple command or message to the program that runs the ServerSocket, which will then shut the ServerSocket down.

Here is some pseudo-code, it should only serve to give you an idea:
+Pie Number of slices to send: Send
Thanks Wouter Oet &
Stephan van Hulst

Your suggestions worked.

--Murali
No matter how many women are assigned to the project, a pregnancy takes nine months. Much longer than this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 795 times.
Similar Threads
Calling an open socket server
Closing the server socket
port not reopening
Reset ServerSocket
connect two comps with socket newbie Q
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 01:21:49.