Closed Bug 552785 Opened 16 years ago Closed 16 years ago

PR_Recv blocks a non-blocking socket on Windows CE

Categories

(NSPR :: NSPR, defect)

ARM
Windows CE
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: alexp, Assigned: wtc)

Details

Attachments

(1 file, 1 obsolete file)

PR_Recv called on a non-blocking socket is supposed to return with PR_WOULD_BLOCK_ERROR if no incoming data is available at the socket. But on Windows CE it waits for data blocking the caller.
Assignee: wtc → alexp
Status: NEW → ASSIGNED
Attached patch Fix (obsolete) — — Splinter Review
We use w95sock.c implementation for Windows CE, which didn't do anything to make a socket non-blocking as Win95 does not support that. WinCE on the other hand supports ioctlsocket(), which could be used.
Attachment #432921 - Flags: superreview?(wtc)
Attachment #432921 - Flags: review?(bugmail)
Attachment #432921 - Flags: review?(bugmail) → review+
Alex, your comment 1 is inaccurate because Win95 supports ioctlsocket. We call ioctlsocket in _PR_MD_SOCKET, when we create a socket: http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/nsprpub/pr/src/md/windows/w95sock.c&rev=3.17&mark=147,163#146 _MD_MakeNonblock is a no-op as a performance optimization because a socket returned by accept() inherits the non-blocking mode from the listening socket. Perhaps that property is not inherited on Windows CE, which is why you need this patch?
(In reply to comment #2) > Alex, your comment 1 is inaccurate because Win95 supports ioctlsocket. You're right. I referred to the wrong section of MSDN. > _MD_MakeNonblock is a no-op as a performance optimization because > a socket returned by accept() inherits the non-blocking mode from > the listening socket. Perhaps that property is not inherited on > Windows CE, which is why you need this patch? That's probably the case. PR_Accept works as it should in the nonblock test, but the PR_Recv call on the socket returned by the accept fails. Anyway, the patch seems to fix the problem on WinCE. Do you have any suggestions on a better fix?
Comment on attachment 432921 [details] [diff] [review] Fix r=wtc. I just wanted to make sure we know what the problem is. Please add a comment to this function to note that why _MD_MakeNonblock can do nothing for non-WINCE. Thanks.
Attachment #432921 - Flags: superreview?(wtc) → superreview+
Attachment #432921 - Attachment is obsolete: true
Attachment #432936 - Flags: review+
Assignee: alexp → wtc
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: