Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TidTCPServer help

774 views
Skip to first unread message

Del

unread,
Oct 21, 2015, 4:38:17 AM10/21/15
to
I have multiple devices that need to connect to my application and I need to listen and send data back to these devices.

I'm using the indy TidCPServer (ver 10) and have not done any communication stuff like this before and was hoping someone could point me in the right direction.

When I start the Server I get the OnConnect event fired any send the data back to the device which accepts the connection and all ok.
This is what is received

GET /iclock/cdata?SN=0800143000115&options=all&pushver=EU3.1&language=69 HTTP/1.0
Host: 192.168.0.3:82
User-Agent: iClock Proxy/1.09
Connection: close
Accept: */*


and then I send back the data below to establish connection

HTTP/1.0 200 OK
Server: cx1193719-b
Content-Type: text/plain
Accept-Ranges: bytes
Date: Wed, 21 Oct 2015 09:29:09 GMT
Content-Length: 228

GET OPTION FROM:0800143000115
AttStamp=504122440
OpStamp=507733791
PhotoStamp=1
ErrorDelay=30
Delay=15
TransTimes=00:00;14:05
TransInterval=1
TransFlag=10011111110000
Realtime=1
Encrypt=0
TimeZoneclock=1
TimeZone=1



Periodically the device sends a message to the server sometimes with a request or sending data from the device to the app, this fire's the Onexecute event which I have just added some basic code to see what comes back

procedure TForm2.IdTCPServer1Execute(AContext: TIdContext);
var s:String;
begin

s:=AContext.Connection.Socket.ReadLn();
memo1.Lines.Add(datetimetostr(now)+' Execute Data:='+s);
//AContext.Connection.Disconnect;

end;

If I do the disconnect everything seems to work but if I don't I then don't get any more data back.
Bit at of a newbie at this so any help would be much appreciated


0 new messages