[fpc-pascal] Re: Odyssey: SSockets and Threads.

silvioprog silvioprog at gmail.com
Thu Apr 25 17:06:18 CEST 2013


2013/4/25 Michael Van Canneyt <michael at freepascal.org>

> Why is that ?
>
> Please define "read and write at the same time" first.


Sorry, my English is bad. ^^

So, a small example (pseudo code):

procedure TMyThread1.Execute;
begin
  while not Terminated do
  begin
    GlobalSocket.Write ...
  end;
end;

procedure TMyThread2.Execute;
begin
  while not Terminated do
  begin
    GlobalSocket.Read ...
  end;
end;

MyThread1.Start;
MyThread2.Start;

 Thank you!
>>
>> * https://bitbucket.org/**silvioprog/tcpipcomp<https://bitbucket.org/silvioprog/tcpipcomp> (this
>> repo is temporary, and this all code can undergo drastic changes at any
>> time)
>>
>>
>> ... like ScktComp of Delphi. (no Synapse, LNet or Indy please, I need to
>> use native code)
>>
>
> Strange remark. Synapse, lnet or Indy are native pascal code.
>
> Michael.


Yes, I love Synapse, but it is not distributed with Free Pascal. I think
the Free Pascal need to distribute something like SktComp(
http://pastebin.com/QBZU89cy) of Delphi. SSockets is not multi-threaded.

-- 
Silvio Cl├ęcio
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130425/e37154f0/attachment.html>


More information about the fpc-pascal mailing list