• Post Reply Bookmark Topic Watch Topic
  • New Topic

Closing the server socket  RSS feed

 
Vijayalakshmi Karthikeyan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written a socket program which should listen continuously for the client. I need to close the server socket through another java program . This will be called via a script. There is no relation with two programs
1) Server socket open program
2) close program

Can any one tell me how to do this.
URGENT
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remember that PatienceIsAVirtue. Posting urgent really doesn't help. In fact I think it's quite the opposite.

The easiest way do to that is to create a connection to the program and send a kind of close command.
 
Vijayalakshmi Karthikeyan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There should not be any connection between two programs
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not?
 
Vijayalakshmi Karthikeyan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually our requirement is like
1) a port should be opened and it should listen for the client. (This program is run through a separate script)
2) a close connection program that will be called only during maintenance period through another script.
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In those requirements I don't see where it says that there can't be a connection between the two programs.
 
Andrey Kozhanov
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of the possible solutions is as follows.

'Close' program creates empty file on the special location. First program regulary checks for existance of this file. If file exists - program closes.
 
Vijayalakshmi Karthikeyan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you . I think it will work . I will check in creating of file.
Thank you all once again
 
MuraliManohar Chepuri
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey same question is already answered in a topic with subject "
Wud it be possible to Open a ServerSocket from one program and Close from another program " ...

Please go through it.

Thanks,
Murali
 
Vijayalakshmi Karthikeyan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wouter Oet
Post Thursday, 7 October 2010 14:02:44 Subject: Closing the server socket
In those requirements I don't see where it says that there can't be a connection between the two programs.

Hi i made an connection and i was able to do it. Thank you. Sorry for my late reply.
MuraliManohar Chepuri
Post Monday, 11 October 2010 22:41:47 Subject: Closing the server socket
Hey same question is already answered in a topic with subject "
Wud it be possible to Open a ServerSocket from one program and Close from another program " ...


I went through it and i applied the same. But i have one doubt. Is it required that we should use thread concept
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!