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)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: alexp, Assigned: wtc)
Details
Attachments
(1 file, 1 obsolete file)
|
1.09 KB,
patch
|
alexp
:
review+
|
Details | Diff | Splinter Review |
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.
| Reporter | ||
Updated•16 years ago
|
Assignee: wtc → alexp
Status: NEW → ASSIGNED
| Reporter | ||
Comment 1•16 years ago
|
||
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)
Updated•16 years ago
|
Attachment #432921 -
Flags: review?(bugmail) → review+
| Assignee | ||
Comment 2•16 years ago
|
||
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?
| Reporter | ||
Comment 3•16 years ago
|
||
(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?
| Assignee | ||
Comment 4•16 years ago
|
||
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+
| Reporter | ||
Comment 5•16 years ago
|
||
Attachment #432921 -
Attachment is obsolete: true
Attachment #432936 -
Flags: review+
| Reporter | ||
Updated•16 years ago
|
Assignee: alexp → wtc
| Reporter | ||
Updated•16 years ago
|
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.
Description
•