• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
MuraliManohar Chepuri
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

Thanks,
Murali
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Stephan van Hulst
Bartender
Posts: 6583
84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
MuraliManohar Chepuri
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Wouter Oet &
Stephan van Hulst

Your suggestions worked.

--Murali
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!