Re: getlasterror 997 after blocking recv returns error
- From: "Alexander Nickolov" <agnickolov@xxxxxxxx>
- Date: Wed, 21 Jun 2006 10:04:00 -0700
Check what LSPs you have installed on your system. It looks
suspiciously like a misbehaving LSP...
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"DW" <DZ@xxxxxxxxxxxxx> wrote in message
news:EDB76C6A-12C7-4907-AE59-FCE6729F7870@xxxxxxxxxxxxxxxx
Charles, I checked the code and the only calls being made once the socket
has
been connected is recv, send, and setsockopt to set the receive timeout if
we
need the receiving thread to be more responsive. So I'm sure that we
aren't
switching to non-blocking mode.
However, as I was looking through the code to check all socket-related
calls
being made, I noticed that the application is using ws2_32.lib but is
calling
WSAStartup() with version 1.1. I checked the online document and there is
no
combination for a version 1.1 requested by app and a version 2.0 DLL. I'll
try specifying version 2.2 to see if this problem still occurs. Thanks.
"Charles Wang[MSFT]" wrote:
Hi,
Thanks for your post!
From your description, I understand that:
You got the error WSA_IO_PENDING which indicated the socket was under
overlapped I/O mode.
But you believed that the socket was under the blocking mode and the
error
shouldn't be thrown out.
If I have misunderstood, please feel free to let me know.
As my experiences, some function invokings will cause the socket I/O mode
changing from blocking to nonblocking, such as WSAAsyncSelect
,WSAEventSelect, etc.
You can use ioctlsocket to control the sockt I/O mode.
Also, as MSDN says:
To set the socket back to blocking mode, an application must first
disable
WSAAsyncSelect by calling WSAAsyncSelect with the lEvent parameter equal
to
zero, or disable WSAEventSelect by calling WSAEventSelect with the
lNetworkEvents parameter equal to zero.
For more detailed information of ioctlsocket and windows socket blocking
routines, you can refer to:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/win
sock/ioctlsocket_2.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/win
sock/windows_sockets_1_1_blocking_routines_and_einprogress_2.asp
Please confirm whether your application error was caused by above
reasons.
If you have any other concerns, please feel free to let me know. It's my
pleasure to be of assistance.
+++++++++++++++++++++++++++
Charles Wang
Microsoft Online Partner Support
+++++++++++++++++++++++++++
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
Business-Critical Phone Support (BCPS) provides you with technical phone
support at no charge during critical LAN outages or "business down"
situations. This benefit is available 24 hours a day, 7 days a week to
all
Microsoft technology partners in the United States and Canada.
This and other support options are available here:
BCPS:
https://partner.microsoft.com/US/technicalsupport/supportoverview/40010469
Others:
https://partner.microsoft.com/US/technicalsupport/supportoverview/
If you are outside the United States, please visit our International
Support page:
http://support.microsoft.com/default.aspx?scid=%2finternational.aspx.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
.
- References:
- RE: getlasterror 997 after blocking recv returns error
- From: Charles Wang[MSFT]
- RE: getlasterror 997 after blocking recv returns error
- From: DW
- RE: getlasterror 997 after blocking recv returns error
- Prev by Date: Re: Blocking internet Access
- Next by Date: Re: WinInet - multi connections
- Previous by thread: RE: getlasterror 997 after blocking recv returns error
- Next by thread: RE: getlasterror 997 after blocking recv returns error
- Index(es):