Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: (tye)Re: Win32 Nonblocking Sockets

by ncw (Friar)
on Apr 21, 2001 at 02:50 UTC ( #74361=note: print w/replies, xml ) Need Help??


in reply to (tye)Re: Win32 Nonblocking Sockets
in thread Win32 Nonblocking Sockets

Windows does have fcntl but doesn't include O_NONBLOCK (according to mingw's headers). However I have coded non blocking sockets in a cross platform program. I used ioctl like this
int on = 1; int error = IOCTL(server_socket, FIONBIO, &on); if (error < 0) die("Couldn't set non-blocking");
Note that IOCTL == ioctl under unix and == ioctlsocket under windows.

I don't know whether this is useful directly from perl under windows or not but it could certainly go in the xs module.

Non blocking sockets are OK under windows, but it is practically impossible to make anything else non blocking - you have to get into overlapped IO etc shudder!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://74361]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2022-01-25 16:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (67 votes). Check out past polls.

    Notices?