Re: CAsyncSocket::DoCallBack, the ASSERT
From: Adrian Rapiteanu (adrian_rapiteanu_at_hotmail.com)
Date: 05/18/04
- Next message: Scott McPhillips [MVP]: "Re: When To Initialize View Controls In a Document View MFC Architecture"
- Previous message: Jeff Partch: "Re: How to redimension client area of a window"
- In reply to: Joseph M. Newcomer: "Re: CAsyncSocket::DoCallBack, the ASSERT"
- Next in thread: Joseph M. Newcomer: "Re: CAsyncSocket::DoCallBack, the ASSERT"
- Reply: Joseph M. Newcomer: "Re: CAsyncSocket::DoCallBack, the ASSERT"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 18 May 2004 18:30:13 -0400
Thank you for your reply. I don't have any child thread. What I have is in
the OnInitDialog() of my main dialog ( I have a dialog based application) I
create a new class, that have a member variable derived from CAsyncSocket,
with new operator and call a method Init(), that will create the socket.
The assert appears very occasionally and is very hard to reproduce.
Thank you,
Adrian
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
news:onnka0hmd92vg39c60cijihs7sg5bgk092@4ax.com...
> Are you using threads? If so, there are special precautions to take;
socket operations
> cannot cross thread boundaries, and there is a special "protocol" you must
follow when
> handing a socket from one thread to another, and only one thread at a time
is allowed to
> deal with a socket. Check out my essay on UI threads on my MVP Tips site.
>
> There may be other causes, but most of the time I see problems like this,
they are caused
> by violating the threading model.
> joe
>
> On Tue, 18 May 2004 13:02:45 -0400, "Adrian Rapiteanu"
<adrian_rapiteanu@hotmail.com>
> wrote:
>
> >The only events that I'm handling are: OnReceive(), OnClose(), OnSend(),
and
> >OnConnect().
> >
> >Adrian
> >
> >
> >"Frank Hickman" <fhickman_nosp@m_noblesoft.com> wrote in message
> >news:T5KdneJfAuNAqTfdRVn-hA@comcast.com...
> >> It sounds like something is calling the callback function prior to the
> >call
> >> to Accept. When the socket is created, what events are you handling?
> >>
> >> --
> >> Frank
> >>
> >> "Adrian Rapiteanu" <adrian_rapiteanu@hotmail.com> wrote in message
> >> news:eGyEHOOPEHA.2716@tk2msftngp13.phx.gbl...
> >> > Hi,
> >> > I have an MFC application using CAsyncSocket and I have a problem
when I
> >> try
> >> > to close the socket.
> >> > CAsyncSocket occasionally asserts while accepting connections in
> >> > CAsyncSocket::DoCallBack, the ASSERT just below the "Must be in the
> >middle
> >> > of an Accept call" comment.
> >> > I wonder if anyone is familiar with this problem.
> >> >
> >> > Thank you,
> >> > Adrian
> >> >
> >> >
> >>
> >>
> >
>
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm
- Next message: Scott McPhillips [MVP]: "Re: When To Initialize View Controls In a Document View MFC Architecture"
- Previous message: Jeff Partch: "Re: How to redimension client area of a window"
- In reply to: Joseph M. Newcomer: "Re: CAsyncSocket::DoCallBack, the ASSERT"
- Next in thread: Joseph M. Newcomer: "Re: CAsyncSocket::DoCallBack, the ASSERT"
- Reply: Joseph M. Newcomer: "Re: CAsyncSocket::DoCallBack, the ASSERT"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|