Re: CAsyncSocket blocks
From: Mikael Setterberg (setterberg_at_hotmail.com)
Date: 05/25/04
- Next message: Peter Koch Larsen: "Embedded VC++ woes."
- Previous message: PrasadBM: "Re: ERROR_SERVICE_NOT_ACTIVE when i try to use BthCreateACLConnection."
- In reply to: Paul G. Tobey [eMVP]: "Re: CAsyncSocket blocks"
- Next in thread: Paul G. Tobey [eMVP]: "Re: CAsyncSocket blocks"
- Reply: Paul G. Tobey [eMVP]: "Re: CAsyncSocket blocks"
- Messages sorted by: [ date ] [ thread ]
Date: 25 May 2004 06:10:20 -0700
Thanks for your reply!
If that is the case (which it sure looks like), why does Microsoft
make a distiction between blocking and non-blocking sockets?
CAsyncSocket is supposed to be non-blocking. I have not found a way of
reading the send buffer status either so I cannot know if the call is
going to block or not. And trying to change the TCP/IP send timeout is
not supported by WinSock..
Thanks,
Mikael
> I think that your guess about what it should do is wrong. When there's no
> more room to buffer packets, the send should *block*, waiting for enough
> room in the buffer to store the bytes which you requested to have sent. If
> no space in the buffer is cleared in a sufficiently long time (the other end
> of the connection is no longer reachable, as far as TCP/IP can tell,
> basically), the send will fail entirely and the socket will drop into an
> error state where you must reconnect to reestablish communication.
>
> Paul T.
>
> > Hi,
> > I'm developing an application where a Windows CE 4.1 client connects
> > via Wireless Ethernet to a server on an XP machine. When the
> > connection has been established, the client continously streams
> > (~200KByte/s) data to the server. I use eVC and the CAsyncSocket class
> > and is has worked out fine.
> > However, the speed of the WL connection is not constant and depends on
> > the distance to the nearest access point. The problem (as far as I
> > understand) arises when the speed has dropped to a level where the
> > TCP/IP connection cannot keep up anymore and the data in the send
> > buffer starts to grow until the buffer is full. Suddenly the
> > CAsyncSocket::Send function stops returning and instead gets stuck. I
> > would expect it to return a number of bytes sent lower than originally
> > requested in the call? I use a 200KByte send buffer at the moment.
> > I cannot figure out why the socket behaves like this. Has anyone else
> > experienced this?
> >
> > Thanks,
> >
> > Mikael
- Next message: Peter Koch Larsen: "Embedded VC++ woes."
- Previous message: PrasadBM: "Re: ERROR_SERVICE_NOT_ACTIVE when i try to use BthCreateACLConnection."
- In reply to: Paul G. Tobey [eMVP]: "Re: CAsyncSocket blocks"
- Next in thread: Paul G. Tobey [eMVP]: "Re: CAsyncSocket blocks"
- Reply: Paul G. Tobey [eMVP]: "Re: CAsyncSocket blocks"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|