Net code bug?
by Matthew DeKrey · in Torque Game Engine · 03/16/2007 (9:34 am) · 4 replies
Alright, this bug is really bothering me... it happens in both TGE 1.4.2 and TGEA, both with a fresh download, running in Windows XP with VS2005.
I can run anything (even the default demo) and close it (I tend to use the console "quit" function but Alt+F4 does it too, along with any other methods of exiting) either immediately or after some play, and I get a crash that can be traced back to the Net::closePort function, which is line 475 in winNet.cpp for TGEA. I'm not sure what's wrong here - I can get my engine to work by just disabling the net code at init and shutdown, but I'd really like to use the network in future projects.
Is this a bug with my version of Winsock? Or are there others with the issue?
Thanks for your help!
I can run anything (even the default demo) and close it (I tend to use the console "quit" function but Alt+F4 does it too, along with any other methods of exiting) either immediately or after some play, and I get a crash that can be traced back to the Net::closePort function, which is line 475 in winNet.cpp for TGEA. I'm not sure what's wrong here - I can get my engine to work by just disabling the net code at init and shutdown, but I'd really like to use the network in future projects.
Is this a bug with my version of Winsock? Or are there others with the issue?
Thanks for your help!
#2
It breaks on the closesocket(udpSocket); line. I've checked all the other closesocket calls and none are being hit before this particular error...
03/16/2007 (11:25 am)
Oh, oops - yeah, I meant to mention that.It breaks on the closesocket(udpSocket); line. I've checked all the other closesocket calls and none are being hit before this particular error...
#3
Hopefully it is breaking inside of Net::closeSocket() and not closeSocket from the socketAPI. If it is breaking in Net::closeSocket(), any busted values or lines you can give me?
03/16/2007 (11:33 am)
Are you able to break on that line, and see if udpsocket is invalid. Or step into closeSocket() and see what is invalid in that function?Hopefully it is breaking inside of Net::closeSocket() and not closeSocket from the socketAPI. If it is breaking in Net::closeSocket(), any busted values or lines you can give me?
#4
And the udpSocket seems to have valid values; it keeps the same value from openPort when it is called.
The only problem I could suspect from my knowledge of networking (which is fairly minimal) is that the recvfrom(udpSocket...) in Net::process call is being processed while closesocket is being called... which would most certainly create some issues. As it is a dual core machine, I suppose it is possible, but I wouldn't expect it to happen every time...
Oh, and thanks for all the responses so far.
03/16/2007 (1:19 pm)
Unfortunately, no... that is a closesocket from socketAPI... udpSocket is a SOCKET data type, so I assume that the correct function is being called.And the udpSocket seems to have valid values; it keeps the same value from openPort when it is called.
The only problem I could suspect from my knowledge of networking (which is fairly minimal) is that the recvfrom(udpSocket...) in Net::process call is being processed while closesocket is being called... which would most certainly create some issues. As it is a dual core machine, I suppose it is possible, but I wouldn't expect it to happen every time...
Oh, and thanks for all the responses so far.
Employee Michael Perry
ZombieShortbus