This site is no longer active and is available for archival purposes only. Registration and login is disabled.

strange sockets behavior


strange sockets behavior

Postby jaguard » Feb 25, 2007 @ 2:44pm

Has anyone tried doing client-server stuff on the pocketpc? I found something looking like a bug, and it took me a vast amount of time to locate the source.
I'm operating on non-blocking sockets, unsing tcp/ip streaming operation. I didn't bother if there's a data to recieve, since non-blocking sockets should return in any case, returning error explaining me what's going wrong.
This didn't work. When I call recv(), it never returns if there is no data, or if I request more than it can recieve. This is wrong. There is a plain statement about non-blocking sockets in msdn:

WSAEWOULDBLOCK
10035
Resource temporarily unavailable.
This error is returned from operations on nonblocking sockets that cannot be completed immediately, for example recv when no data is queued to be read from the socket. It is a nonfatal error, and the operation should be retried later. It is normal for WSAEWOULDBLOCK to be reported as the result from calling connect on a nonblocking SOCK_STREAM socket, since some time must elapse for the connection to be established.


So it should return immidiately -1, and the get last error should return 10035 absolutely. This is what happens on a PC, but on a PocketPC recv hangs, and I had to reset my PDA. Though I can close connection on the other device, only then recv returns.

It took me 3 days banging my head into the wall to fix the stuff by calling ioctlsocket before(though I had to rewrite a lot of stuff until I discovered what actually must be done).

Can anyone comment, why is this happenning on a PocketPC?
jaguard
pm Member
 
Posts: 230
Joined: Mar 2, 2004 @ 6:45pm


Postby Dan East » Feb 25, 2007 @ 7:33pm

User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby jaguard » Feb 26, 2007 @ 5:40pm

jaguard
pm Member
 
Posts: 230
Joined: Mar 2, 2004 @ 6:45pm


Postby fast_rx » Feb 26, 2007 @ 11:11pm

User avatar
fast_rx
pm Member
 
Posts: 660
Joined: Jun 10, 2003 @ 4:24pm


Postby jaguard » Feb 27, 2007 @ 10:45am

jaguard
pm Member
 
Posts: 230
Joined: Mar 2, 2004 @ 6:45pm


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron