Board index » delphi » Indy blocking sockets

Indy blocking sockets

I saw Indy are blocking, so in my program I have to call WriteLn and ReadLn
according to my communication protocol.

But in my application, both the server and the client can communicate (ie
the client ask something and the server aswers, or in the second case the
server choose to send a news to the connected clients).

So how can I write my client and my server to be able to do this sort of
communication?

Thanks, Damiano Curia

 

Re:Indy blocking sockets


Hi, check out the chat demo coming with Indy. You may find some useful info
to get started. Also, you will be able to understand how to do what you
want.

---
Sergio.

Re:Indy blocking sockets


Easy - Use the non-blocking TServerSocket and TClientSocket...

...MC

Quote
Damiano Curia <curiad...@tiscalinet.it> wrote in message

news:3b4b0637_2@dnews...
Quote
> I saw Indy are blocking, so in my program I have to call WriteLn and
ReadLn
> according to my communication protocol.

> But in my application, both the server and the client can communicate (ie
> the client ask something and the server aswers, or in the second case the
> server choose to send a news to the connected clients).

> So how can I write my client and my server to be able to do this sort of
> communication?

> Thanks, Damiano Curia

Re:Indy blocking sockets


M...@ringtek.com.antispam (Mike C) wrote in <3b4badd3_1@dnews>:

Quote
>Easy - Use the non-blocking TServerSocket and TClientSocket...

It makes no difference whether blocking or non-blocking is used for what
he's asking.

Re:Indy blocking sockets


Once a communication has been established between your client and server,
any of them can send/recieve. However, if you want to establish
communication both-ways (i.e. either the client initiates it or the
"server" intiates it), you would need both a client and server socket on
each end.

Other Threads