Board index » delphi » How to post message from TCP Server to Client

How to post message from TCP Server to Client

Maybe it's stupid question ...
Is there any way how to send data from TCP server to client. I mean
that I make to connect to TCP Server and send some data and I don't
want to wait on respond (asynchron. comunication) from server.
After server send back to rigth client answer.
 

Re:How to post message from TCP Server to Client


Quote
Radim Vongrej <vong...@datec.cz> wrote in message news:Xns90F876FE88949vongrejdateccz@207.105.83.65...
> Maybe it's stupid question ...
> Is there any way how to send data from TCP server to client. I mean
> that I make to connect to TCP Server and send some data and I don't
> want to wait on respond (asynchron. comunication) from server.
> After server send back to rigth client answer.

Your question is a little unclear.  If you want to send unsolicited data to a
connected client, you need access to something in the server thread that
handles the client.  With netMasters comps, this is the winSocketStream
object.  With Indy, don't know, but someone will.   You will probably need
a critical section or mutex somewhere..

On the other hand, this may not be what you're asking..  :-)

Good luck,
Martin

Re:How to post message from TCP Server to Client


If you're using the TServerSocket and TClientSocket in delphi, set
ServerType and ClientType (depending on which component) to stBlocking,
ctBlocking.
In that case each command is completed  before passing on to the next code
ie sockets are synchronous.
Take a look too at the Indy components which are blocking and cut out a lot
of programming

--
Claire
Snr Software Engineer
icq 124891230

Quote
"Radim Vongrej" <vong...@datec.cz> wrote in message

news:Xns90F876FE88949vongrejdateccz@207.105.83.65...
Quote
> Maybe it's stupid question ...
> Is there any way how to send data from TCP server to client. I mean
> that I make to connect to TCP Server and send some data and I don't
> want to wait on respond (asynchron. comunication) from server.
> After server send back to rigth client answer.

Other Threads