Jump to content

TCP Port stops responding after running for a few hours

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
Aaron

Aaron

    Newbie

  • Members
  • Pip
  • 1 posts
Hi,
I have a game server thats coded in C# and .net framework 4.0

The server has two methods of recieving and sending data, one is for data through the website, and the other is for actual game server traffic from the game client.

The server will be running for 3+ hours perfectly stable, and accepting data with no issues, then it will basically just stop sending and receiving data on the gameport. But theres still some type of transmission going on becase the client doesn't disconnect until I actually go ahead and reboot the entire server application.

The port for data from the website will continue to work fine, it does small things such as update different aspects of the users account like its Mission.

I know the website port is still working because the Emulator for the game writes out when it recieves data via that port.

If you guys have any ideas on what may be causing this, please help me out! If you need any more info, feel free to ask!

Thanks

#2
BuckAMayzing

BuckAMayzing

    Learning Programmer

  • Members
  • PipPipPip
  • 39 posts
Well, maybe. I can offer a suggestion at least, but I haven't done much work with TCP communication. I did however have a similar issue with a program I wrote that was working as a front end for a database managed by MSSQL. I ran into an issue where things seemed to stop responding randomly. Turns out that the problem was caused when I didn't close the connection if my code entered a catch block. If you open your connection before you initiate communication and immediately close it afterward, you could be running into a similar problem.

#3
zoranh

zoranh

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 207 posts

BuckAMayzing said:

Well, maybe. I can offer a suggestion at least, but I haven't done much work with TCP communication. I did however have a similar issue with a program I wrote that was working as a front end for a database managed by MSSQL. I ran into an issue where things seemed to stop responding randomly. Turns out that the problem was caused when I didn't close the connection if my code entered a catch block. If you open your connection before you initiate communication and immediately close it afterward, you could be running into a similar problem.

Similar problem is when using asynchronous communication and there is an execution path which turns out to not call BeginReceive once previous EndReceive was completed. This makes socket ignorant to all further data sent by the remote side.

#4
BuckAMayzing

BuckAMayzing

    Learning Programmer

  • Members
  • PipPipPip
  • 39 posts

zoranh said:

Similar problem is when using asynchronous communication and there is an execution path which turns out to not call BeginReceive once previous EndReceive was completed. This makes socket ignorant to all further data sent by the remote side.

Yeah, I actually did some asynchronous TCP coding a couple of weeks ago. If the callback method doesn't begin listening for the next client, then I had the problem. So it would make sense that this could be the problem.

#5
yoda174

yoda174

    Newbie

  • Members
  • PipPip
  • 25 posts
And what kind of game do you work about? :D I want to know more about game servers with c#. Please let me know : harsanyi.david1993@gmail.com

Thanx and sory for my englosh