Tcpobject
by Patrick Bergeron · in Torque Game Builder · 11/22/2005 (6:55 pm) · 1 replies
I noticed a few posts about the TCPObject class. Has anyone been able to get this object working from within Torque2D? I am assuming you can persist connections. Any samples, tutorials, or more information that could help me get started with this object would be awesome.
Thanks for any help.
Thanks for any help.
Torque 3D Owner Luke D
Default Studio Name
I don't have any clean actual-code samples right this second, but the typical init and execution is pretty short. Just something like this:
new TCPObject(TCPConnection); TCPConnection.connect("someserver.com:80"); TCPConnection.send("Outbound string here\n"); function TCPConnection::onLine(%this, %line) { echo("Incoming line: " @ %line); } function TCPConnection::onConnected(%this) { echo("Connected!"); } function TCPConnection::onDisconnect(%this) { echo("Disconnected!"); }There are other callbacks for various connection status messages but those are the main three you'll need to get started.