Re: [twsocket] Send data as a never ending document

2010-02-03 Thread Paul

Are you using chunked transfer encoding, or something else?

That's what I'm doing, at least I'm trying to, but it's still not working.
Do you have an example sending it with a THttpCli ?


regards,

Paul


--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Send data as a never ending document

2010-02-03 Thread RTT



Are you using chunked transfer encoding, or something else?
That's what I'm doing, at least I'm trying to, but it's still not 
working.

Do you have an example sending it with a THttpCli ?
No, just with httpserver. Are you able to properly set up the encoding, 
or it just don't work as you want, and the connection continues to close.

Here is how I, generically, made it

...

   Header := 'HTTP/1.1 200 OK' + crlf;
   Header := Header + 'Connection: keep-alive' + crlf;
   Header := Header + 'Transfer-Encoding: chunked' + crlf;
   HttpConnection.SendStr(Header + crlf);
   s := IntToHex(BufLen, 2) + crlf;
   HttpConnection.Send(@s[1], Length(s));
   HttpConnection.Send(buf, BufLen)
   HttpConnection.Send(@crlf[1], 2)


And you have to repeat the above code until all data you need to send is 
sent.

When all sent:

   s := '0' + crlf + crlf;
   HttpConnection.send(@s[1], length(s));

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Send data as a never ending document

2010-02-03 Thread RTT



the problem I have is that the messages contain binary data.


I'm sending binary data with that code without problem. Every chunk 
header inform of the data length the chunk message body has, so, the 
type of data in the message body is errelevant.
Never tested with an THttpCli, but you just need to issue a POST 
request, and chunk encode the data, or I'm seeing it wrongly?

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Send data as a never ending document

2010-02-02 Thread Paul

Found it, I forgot to set linemode properly :-(

Paul
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Send data as a never ending document

2010-02-02 Thread RTT

Are you using chunked transfer encoding, or something else?

Found it, I forgot to set linemode properly :-(

Paul


--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be