Re: How do I define the Source port value when creating a socket
- From: "Morris Neuman" <Morris@xxxxxxxxxxxxx>
- Date: Fri, 7 Oct 2005 15:29:03 -0700
Thanks again for your feedback it is extremely helpfull.
I have the crash log from the event viewer listed below. But before that
may I ask a dumb question. I am using the WSA() calls, are they the MFC
wrappers you mentioned? Or are there other socket calls in MFC. If there
are yet others should I be using the WSAsocket() vs the plain socket() calls.
To follow sample code in MSDN, I used the socket() on the listening socket
and left WSASocket() call on the sending socket when I create the sockets.
Here is the crash event log in case you can interpert it and let me know
what went wrong. ( it was MFC42u.dll ) . I'm a telephony programmer moving
onto the IP world. Any insight would be appreciated
Event Type: Error
Event Source: Application Error
Event Category: (100)
Event ID: 1000
Date: 10/7/2005
Time: 2:53:53 PM
User: N/A
Computer: CRCMNIVR
Description:
Faulting application SMSrvr.exe, version 3.1.0.6, faulting module
mfc42u.dll, version 6.0.8447.0, fault address 0x00051a89.
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 41 70 70 6c 69 63 61 74 Applicat
0008: 69 6f 6e 20 46 61 69 6c ion Fail
0010: 75 72 65 20 20 53 4d 53 ure SMS
0018: 72 76 72 2e 65 78 65 20 rvr.exe
0020: 33 2e 31 2e 30 2e 36 20 3.1.0.6
0028: 69 6e 20 6d 66 63 34 32 in mfc42
0030: 75 2e 64 6c 6c 20 36 2e u.dll 6.
0038: 30 2e 38 34 34 37 2e 30 0.8447.0
0040: 20 61 74 20 6f 66 66 73 at offs
0048: 65 74 20 30 30 30 35 31 et 00051
0050: 61 38 39 a89
Thanks again for your help on this.
--
Thanks
Morris
"Eugene Gershnik" wrote:
> Morris Neuman wrote:
> > Thanks so much for your advice. I got it going with your help.
> > But if I may ask, I tried to just do the Bind() on the same socket I
> > do connect() on. but that caused the system to crash with error in
> > some mfcu.dll. I had to make a seperate socket and use that to
> > listen on and that worked.
> >
> > Any thoughts on that? that a best practice on that.
>
> When you have a crash you need to record the location of it, call stack and
> everything else that is reported by your debugger. Otherwise asking about a
> crash without such info is like asking a doctor for the diagnosis based only
> on "I have a headache" complaint ;-)
>
> bind() and connect() on the same socket should work fine but it is usually a
> bad idea. This group contains plenty of discussions on this issue so you
> might want to google them out.
>
> Since you mention mfcu.dll I assume that your application uses MFC. If so,
> another advice would be to stay away from MFC sockets wrappers and use plain
> Winsock API instead.
>
>
> --
> Eugene
> http://www.gershnik.com
>
>
>
.
- Follow-Ups:
- Re: How do I define the Source port value when creating a socket
- From: Eugene Gershnik
- Re: How do I define the Source port value when creating a socket
- References:
- Re: How do I define the Source port value when creating a socket ?
- From: Eugene Gershnik
- Re: How do I define the Source port value when creating a socket
- From: Eugene Gershnik
- Re: How do I define the Source port value when creating a socket ?
- Prev by Date: Re: How do I define the Source port value when creating a socket
- Next by Date: Re: How do I define the Source port value when creating a socket
- Previous by thread: Re: How do I define the Source port value when creating a socket
- Next by thread: Re: How do I define the Source port value when creating a socket
- Index(es):
Relevant Pages
|