Game Development Community

SOLVED! Engine hangs with Could not write to socket. Error: WSAEWOULDBLOCK.

by Richard Marrevee · in Torque 3D Professional · 11/01/2014 (3:02 am) · 4 replies

When loading a certain mission the engine hangs. Using trace(1) I get an error in the console.log stating:

Could not write to socket. Error: WSAEWOULDBLOCK.

This error is generated in platformNet.cpp in the method Net::Error Net::send(NetSocket socket, const U8 *buffer, S32 bufferSize)

Looking at the console.log it seems that it is somehow AI related (I am using the UAISK) and the engine seems to hang in the think cycle of the bot. There are 59 bots. Loading the mission in the editor doesn't give any problems, also loading the mission in game without the bots give no problem.

It is a single player game but is this some networking problem?
If so is it solvable, or do I need to increase a buffer in size? What buffer?

Help is very appreciated.

Edit: This problem is solved. It had nothing to do with networking, but it was simple a case of an uninitialized field which crashed the engine.

Thanks
Richard

About the author

Started programming in 1984 on an Oric, when time progressed switched to MSX, Amiga and finally the Windows PC with T3D. Now developing an epic fantasy game: The Master's Eye. Creator of the DoorClass pack and VolumetricFog pack @ richardsgamestudio.com


#1
11/01/2014 (4:46 am)
Are you getting this in both debug and release builds or just debug build?
#2
11/01/2014 (8:49 am)
And are you using stock AIPlayer objects? I've had hundreds of units in game before without this issue, so it's surprising with so few.

Do any of the bots mount any new custom class items?

It almost seems like you'd want to walk through this in the debugger as the mission loads to see exactly which object is having the problem sending data. Some people have all the fun....
#3
11/01/2014 (12:47 pm)
@Timmy:
It is only in debug mode.

@Richard:
All stock AIPlayer objects.
#4
11/01/2014 (1:59 pm)
Thanks guys for your assistance. It is solved but had nothing to do with the networking, but an uninitialized field.