Game Development Community

[T3D1.1 Final] TCPObject gives "Got bad connected receive event" LOGGED (THREED-2327)

by Ted Southard · in Torque 3D Professional · 07/29/2011 (11:29 am) · 4 replies

OS: Win7 32-bit

As the title says, TCPObject is not very good when it comes to doing anything aside from listening. There have been several threads about the problem (and workarounds):

Bug thread for 1.1 Preview States: "Bug does not occur on Mac OS X 10.6.8 Torque 3D 1.0.1 with same code"
www.garagegames.com/community/forums/viewthread/57840
www.garagegames.com/community/forums/viewthread/74396
www.garagegames.com/community/forums/viewthread/36871

To reproduce, create a TCPObject and set it to listen on a port, then telnet or connect to it using another Torque instance (or any TCP app to connect to it) and when you send data, you will get "Got bad connected receive event".

About the author

Started with indie games over a decade ago, and now creates tools and tech for games. Currently working as a contractor for startups and game studios.


#1
07/29/2011 (12:06 pm)
Thanks Ted. Logged as THREED-2327.
#2
08/19/2011 (12:53 pm)
Testing forum notification system for Ted.
#3
08/19/2011 (12:56 pm)
One more test.
#4
02/08/2012 (7:00 pm)
FYI. There is no bug here. The TCPObject is working as intended. The issue is that how to create a listener is not well documented.

This is how you should create a listener with TCPObject:

// Create a listener on port 8080.
new TCPObject( TCPListener );
TCPListener.listen( 8080 );

function TCPListener::onConnectionRequest( %this, %address, %id )
{
   // Create a new object to manage the connection.
   new TCPObject( TCPClient, %id );   
}

function TCPClient::onLine( %this, %line )
{
   // Print the line of text from client.
   echo( %line );
}

This will be included in the script reference in the next release.