How do you set sockets to non-blocking?
I'm using the unit, Sockets...
thanks
James

Mailing lists / fpc-pascal / 2002-09
6 messages · 4 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
How do you set sockets to non-blocking?
I'm using the unit, Sockets...
thanks
James
--- James Mills wroteHow do you set sockets to non-blocking? I'm using the unit, Sockets...
with line:
fcntl(conn,F_SetFl,Open_NonBlock);See also attached examples !
=====
Skelet
====== http://skelet.hit.bg
__________________________________________________ Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
Thank you so much... This hasn't really been in the documentation so it was hard to figure out. I've only done it once in C++...
Thank you
James
Content-Description: client.pp
Content-Description: server.pp
How do you set sockets to non-blocking? I'm using the unit, Sockets... thanks James
I remember a while back with C++ I used select and fd's to check if data was available in the socket.
Can that be done with pascal? Could someone show me please, I've almost forgotten how it's done...
cheers
James
Select() is available. Just check the documentation of the linux unit for examples.
Michael.
and, of course, there are libAsync and fpAsync as wrappers for select()... (libAsync is purely procedural, while fpAsync uses classes) As select() can be quite painful in more complex situations, fpAsync will hide most of this complexity, and adds more functionality (e.g. powerful timers). In the future it will be available on more platforms than Linux/Unix.
Both are part of the FPC packages.
- Sebastian