Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2014-10

Synapse TTCPBlockSocket Send and Receive issue

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Krzysztof

Hi,

I need to use TTCPBlockSocket on client side. I need to listen for server messages so I moved TTCPBlockSocket.RecvString(100) to another thread loop. The problem is that I also need same socket to send messages from main thread. I suppose that I need to use critical sections to avoid deadlocks. I'm worrying about efficient because TTCPBlockSocket.RecvString(100) routine need to be also between critical section access (100 milliseconds sleep). Is exists any other way to do this? Maybe better use TApplication.OnIdle event and call RecvString there? I know that LNet are non-blocking but I must use Synapse.

Regards

Reply by email