digitalmars.D - Can't get nonblocking socket.
- Dawid =?ISO-8859-2?Q?Ci=EA=BFarkiewicz?= (10/10) Feb 08 2005 Error: Unable to set socket blocking.
- Regan Heath (40/46) Feb 08 2005 It does look like the same problem. I looked in std.socket and I see:
Error: Unable to set socket blocking. I was googlin' for that but I can't find what am I doing wrong. Maybe someone can give me some advise. I've found this only: http://www.digitalmars.com/d/archives/digitalmars/D/2658.html I've got glibc 2.3.4 - can be this similar problem? Regards, -- Dawid Ciężarkiewicz | arael jid: arael fov.pl
Feb 08 2005
On Tue, 08 Feb 2005 16:10:46 +0100, Dawid Ciężarkiewicz <arael fov.pl> wrote:Error: Unable to set socket blocking. I was googlin' for that but I can't find what am I doing wrong. Maybe someone can give me some advise. I've found this only: http://www.digitalmars.com/d/archives/digitalmars/D/2658.html I've got glibc 2.3.4 - can be this similar problem?It does look like the same problem. I looked in std.socket and I see: which is the error you're getting. I notice it's using fcntl to set the blocking state of the socket. On error it sets errno, so retrieving errno and/or the error message associated might tell us more. To do so call strerror(errno). See the attached file for an example. Ideally add this error string to the exception throw. You'd have to change std.socket and rebuild phobos. I have some code here which uses the 'ioctl' function instead of fcntl, eg. int nonblock = 1; ioctl(sock,FIONBIO,nonblock); so you/we could also try that. You'd have to change std.socket and rebuild phobos. Regan
Feb 08 2005