Steffon Scott

Steffon Scott

  • NA
  • 20
  • 12.5k

Using C# for Socket XML interface

Mar 25 2013 2:00 AM
Ok, so I have this game, which is completely built and functional. The server runs and accepts connects and then communicates with clients via XML.

Server 
[Mar 25 00:06:35 Eastern Daylight Time] Server address 192.168.1.2
[Mar 25 00:06:35 Eastern Daylight Time] Creating socket on port 9999
[Mar 25 00:06:35 Eastern Daylight Time] Binding socket to port

Now I have managed to create a ASP .NET site with basically opens up a connection with the server, and sends a command. I did this just to test it out, however, in doing so I realized the need for a method to sort out who is already connected, or perhaps maintain the connection somehow. For right now every time the page is reloaded a new connection is created. See below:

[Mar 25 01:23:38 Eastern Daylight Time] Connection established, 127.0.0.1:344
[Mar 25 01:24:17 Eastern Daylight Time] Connection established, 127.0.0.1:336
[Mar 25 01:24:20 Eastern Daylight Time] Connection established, 127.0.0.1:336
[Mar 25 01:25:32 Eastern Daylight Time] Connection established, 127.0.0.1:344
[Mar 25 01:32:39 Eastern Daylight Time] Connection established, 127.0.0.1:344
[Mar 25 01:34:55 Eastern Daylight Time] Connection established, 127.0.0.1:284
[Mar 25 01:38:34 Eastern Daylight Time] Connection established, 127.0.0.1:336

This is not going to be acceptable, since many many commands will be sent and responses received over a period of time playing the game. I'm just looking for some advice on what can be done about a situation such as this. I thought I read somewhere about Web or System services but from what I could gather about it I just wasn't sure if that was the right answer. I'd just like someone who can understand what I mean to point me in the right direction so I don't go off wasting time on the wrong solution. Thank you.