Page 1 of 1

Indy network listening

PostPosted: September 28th, 2010, 1:33 am
by Klamber|ext.
Hello.

Wondering if someone could help me.
question is about Indy TcpClient.

Is it somehow possible to keep it listening for incoming data.
Or is there some other way..

I have a server that once in a while sends me some data to update program work.
If i use
Code: Select all
data:=idTcpClient1.readln;

then this hangs the whole program when no data is sent from server..
But i need a way to keep program working and when some data arrives then take action.
I need some event or smth.

Re: Indy network listening

PostPosted: September 28th, 2010, 8:28 pm
by actalk
Hello,

I just used indy in very simple examples.
I'm not an expert indy user.

for your spesific problem:
- you can try, IdAntiFreeze in Indy Misc.
- or you can use indy in multi threaded way.
- or you can examine timeouts to check if there is any data to read.