0

I have set up a successful Tcp server for my XNA game I am developing, I have implemented the client inside the code, but I am having trouble with receiving messages. I know it has to update for each message received but XNA will freeze up as long as I update the receiving? How would I fix this?

tcoy
  • 179
  • 1
  • 3
  • 11

1 Answers1

0

Try making the message calls asynchronous instead. Are you using WCF?

If you're using TcpClient (your other question mentioned it...) then try looking at the BeginConnect method (http://msdn.microsoft.com/en-us/library/ms145193.aspx) and passing in an AsyncCallback object - the MSDN page on AsyncCallback (here - http://msdn.microsoft.com/en-us/library/system.asynccallback.aspx) has an example of an asynchronous TcpClient call.

That should stop XNA from freezing up while it waits for a response.

pete the pagan-gerbil
  • 3,136
  • 2
  • 28
  • 49