Re: CSocket
- From: "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp>
- Date: Wed, 14 Dec 2005 21:24:05 -0500
Michael K. O'Neill wrote:
...CSocket calls the underlying winsock send() function, which returns immediately since the socket is non-blocking. If all data was sent successfully, CSocket::Send() returns, whereas if all data was not yet sent, then CSocket::Send() pumps messages (i.e., it calls AfxPumpMessages()) and then tries the winsock send() function again, until all data is sent successfully or an error on the socket is detected.
So I don't fully understand what you meant when you said that the "app will
stop responding to the user while CSocket is blocked inside a Send or
Receive call..." As far as I can see, the app will continue to respond to
the user since the underlying socket is completely non-blocking and
CSocket::Send() (or Receive()) pumps messages.
Hi Michael,
Thanks. First, it's been a long time since I used CSocket. Once was enough! I later changed that app to CAsyncSocket and I've been using CAsyncSocket ever since.
I'm looking at the source code for the version of CSocket in VC6, and it doesn't agree with your description. For example, there is no call to AfxPumpMessages() in this version. It doesn't pump application messages, only messages sent to the invisible socket window. So perhaps your comments are correct for the more modern versions.
-- Scott McPhillips [VC++ MVP]
.
- Follow-Ups:
- Re: CSocket
- From: Michael K. O'Neill
- Re: CSocket
- References:
- CSocket
- From: Bill Brehm
- Re: CSocket
- From: Scott McPhillips [MVP]
- Re: CSocket
- From: Michael K. O'Neill
- CSocket
- Prev by Date: Registering a CLSID in MFC application
- Next by Date: Debugger doesn't show stativ values
- Previous by thread: Re: CSocket
- Next by thread: Re: CSocket
- Index(es):
Relevant Pages
|