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

silvioprog silvioprog at gmail.com
Fri Apr 26 19:06:36 CEST 2013


2013/4/26 Ludo Brands <ludo.brands at free.fr>

> On 04/26/2013 09:19 AM, Michael Van Canneyt wrote:
> > On Fri, 26 Apr 2013, Ludo Brands wrote:
> >
> >> On 04/26/2013 08:58 AM, Michael Van Canneyt wrote:
> >>>
> >>>
> >>> On Thu, 25 Apr 2013, silvioprog wrote:
> >>>
> >>>> I do not know where it would be used, it's just an observation hehe...
> >>>
> >>> Yes, but the above is what I mean with 'it does not make much sense'.
> >>>
> >>> I can easily add this - in fact I will do so, but with multiple sockets
> >>> it is better to combine the waitfordata()
> >>>
> >>
> >> In blocking mode the select is vital if you want to do simultaneous read
> >> and write on the same socket in the same thread. Otherwise you are
> >> simply blocking the thread in a recv when nothing comes in or in a send
> >> when the socket buffer is not empty. Note that select also returns when
> >> an exception occurs.
> >
> > I am aware of all this.
>
> My message is meant for the OP who wants to do simultaneous read/write
> on the socket in one thread and doesn't know what the use of select is.
> The 'it does not make much sense' is in that context misleading the OP
> and some more explanation was needed;)
>
> Ludo
>


Ludo, a small question....

So, In loop of my thread, to the process doesn't stay blocked in recv, I
need to use select in client too?

-- 
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/20130426/d5163810/attachment.html>


More information about the fpc-pascal mailing list