Hello, I will explain better my doubt. I need to program a multithread server that processes requests of several clients at the same time. At the moment the server processes requests of several clients one to one by the OnReceive callback:
procedure TConnectionHandler.Receive(aSocket: TLSocket);
var
Message: String;
begin
if aSocket.GetMessage(Message) > 0 then
MessagesManager.ProcessMessage(Message);
end;
I want to change the behavior of the server so that it works with one thread for each client request.
Is it possible?
Best regards.
2009/4/18 Ale? Katona
Show quoted text 23 lines
On Thu, 16 Apr 2009 20:01:57 +0200
User wrote:
> How I can use several threads with lNet visual library?
>
> I need some examples.
>
> Best regards!
Hello. lNet is inheritedly not thread-safe but it can be used with threads
in some ways. When it comes to the visual components, you must remember that
the main program loop (handled by the widgetsets) calls the lNet callbacks
(OnReceive etc.) so they are all executed inside the main thread no matter
where you work with the components otherwise.
I'd need some specific use case to give more info.
Ales
_______________________________________________
Lazarus mailing list
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090418/6438364e/attachment.html