• Post Reply Bookmark Topic Watch Topic
  • New Topic

Application Socket Sharing  RSS feed

 
Lars Tode
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I've build an application that connect to a server. The connection works fine and there are no much problems with it.
When I'm start the application again, when the first instance is still running, I get the problem that the program connect again to the server and the server registered the program as a new connection.
All data which is send from the server to this application arrived at the first instance. Is there a possibility to check if there is still an application (my programm in the first instance) is running on the client-site, so that I can stop the client starting before it can connect the server?
Regards
Lars
 
Amit Saini
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
one Possible solutions is:
To record the IP of all clients that connected to the server.
I am assuming that NO more than 1 client can run on a single machine as per Ur requirement.
Whenever a client connects to the server,
Server should check for the client in his database.
If there is an client from the same machine(same IP), then
close the socket, so that if the client-1 socket tries writing on this now 'closed' socket he gets an IOException.
Hope that helps
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!