Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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
Saloon Keeper
Posts: 7713
141
  • 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!