Game Development Community

Tcpobject

by Howard Dortch · in Torque Game Engine · 06/12/2007 (9:29 am) · 2 replies

Could someone explain the send and receive format ?
I have seen some examples from searches but nothing to explain the exact format and ordering
This is taken from example found on this site

%httpCmd="POST /somedir/somefile.php HTTP/1.1\nHost: www.mysite.com:80\nUser-Agent: Torque/1.0 \nAccept: */*\nContent-Length: "@ strlen(%data) @"\nContent-Type: application/x-www-form-urlencoded; charset=UTF-8\n\n" @ %data;

Trying to break this down I can visualize some of the info:

GET or POST - I assume get data or send data
/somedir/counter.php - address of file on server
HTTP/1.1\nHost: - HTTP type not sure what \nHost does
www.mysite.com:80\nUser-Agent: - site address with port
Torque/1.0 \nAccept: - not sure what this does
*/*\nContent-Length: "@ strlen(%data) - assumed length of data to send
and from here it gets muddy except for the end where the data is actually sent.


Is there an order to this? Are there alternate paramaters?

anyone?

#1
06/18/2007 (2:44 pm)
I'm not sure what you're asking.

The code you pasted (not sure where it's from) is using TCPObject to do HTTP.

It should follow the RFC.

We've integrated libcurl to do HTTP and reflected it's functionality into script, and have had good results.
#2
06/19/2007 (11:25 am)
I got it all working fine now thanks.