Angus,

So it does sound like this is at least possible :)

Unfortunately my inexperience with ICS is now going to
Show rather quickly. I've been looking at the Webserver demo
that ships withICS as a basis of what I'm try to achieve.
Please forgive my questions if they are somewhat newbie!

You wrote,
> In the GetDocument event, for your specific path/URL you need to set: 

> Flags := hgWillSendMySelf;
> RemoteClient.KeepAlive = TRUE;

So, do I need to do the same for PostDocument? The webserver example
uses PostDocument and PostedData.

The PostDocument event in the demo requires the Flag parameter to be set
to 
Flags := hgAcceptData before the PostedData event fires.

Changing this to Flags := hgWillSendMySelf prevents this from happening.
So how would I get the posted data with this change?

Apologies if this is way off the mark, ICS is quite different from Indy
;)

Thanks for your valuable input!

Chris.

 


-----Original Message-----
From: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org]
On Behalf Of Angus Robertson - Magenta Systems Ltd
Sent: 18 October 2011 14:23
To: twsocket@elists.org
Subject: Re: [twsocket] HttpServer and Server-push?

> I then need to be able to send HTTP messages (xml documents) back 
> from the server to the client periodically

In the GetDocument event, for your specific path/URL you need to set: 

Flags := hgWillSendMySelf;
RemoteClient.KeepAlive = TRUE;

so the server does nothing more but leaves the connection open, and
start
a client timer which builds and sends the document periodically using
AnswerPage, AnswerString or AnswerStream depending on how much work you
do yourself.  

Remember that ICS is async, so the server is blocked while processing
events like GetDocument, that why you need a timer to send your
responses,
not a never ending loop as in an Indy thread. 

Angus



--
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
--
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

Reply via email to