Darin Fisher <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> honza_b wrote:
>
> >Hi,
> >
> >I'd like to know how to bind the server socket to listen on ipv6
> >address. I'm novice in ipv6 usage and now I use this piece of code:
> >
> >{...
> > pServerSocketIpv6 =
> >do_CreateInstance("@mozilla.org/network/server-socket;1", &rv);
> > NS_ENSURE_SUCCESS(rv, rv);
> >
> > NS_ASSERTION(pServerSocketIpv6 != nsnull, "Instance of server socket
> >is null");
> >
> > PRNetAddr addr;
> > PR_SetNetAddr(PR_IpAddrAny, PR_AF_INET6, m_nPort, &addr);
> >
> > rv = pServerSocketIpv6->InitWithAddress(&addr, 5);
> > NS_ENSURE_SUCCESS(rv, rv);
> >...}
> >
> >
> >There is an assert fail inside of the InitWithAddress().
> >Has any body any suggestion please?
> >
> >Thanks.
> >_______________________________________________
> >Mozilla-netlib mailing list
> >[email protected]
> >http://mail.mozilla.org/listinfo/mozilla-netlib
> >
> >
>
> what assertion are you seeing?
>
> -darin
This assertion is "IsValidNetAddrLen(addr, addrlen) == PR_TRUE"
file $/mozilla/nsprpub/pr/src/io/prsocket.c at line 1078
call stack:
nspr4.dll!PR_Assert(const char * s=0x3002ec60, const char *
file=0x3002eb20, int ln=0x0000043a) Line 538 C
> nspr4.dll!SocketGetName(PRFileDesc * fd=0x00ac62c8, PRNetAddr *
addr=0x00a6ff68) Line 1082 + 0x2c C
necko.dll!nsServerSocket::InitWithAddress(const PRNetAddr *
aAddr=0x0012fc2c, int aBackLog=0x00000005) Line 359 + 0xd C++
This is content of addr local variable passed to InitWithAddress
method:
- addr {raw={family=0x0017 data=0x0012fc2e "y" } inet={family=0x0017
port=0x7917 ip=0x00000000 ...} ipv6={family=0x0017 port=0x7917
flowinfo=0x00000000 ...} } PRNetAddr
+ raw {family=0x0017 data=0x0012fc2e "y" } PRNetAddr::__unnamed
+ inet {family=0x0017 port=0x7917 ip=0x00000000
...} PRNetAddr::__unnamed
- ipv6 {family=0x0017 port=0x7917 flowinfo=0x00000000
...} PRNetAddr::__unnamed
family 0x0017 unsigned short
port 0x7917 unsigned shortA
flowinfo 0x00000000 unsigned int
- ip {_S6_un={_S6_u8=0x0012fc34 "" _S6_u16=0x0012fc34 ""
_S6_u32=0x0012fc34 ...} } PRIPv6Addr
- _S6_un {_S6_u8=0x0012fc34 "" _S6_u16=0x0012fc34 ""
_S6_u32=0x0012fc34 ...} PRIPv6Addr::__unnamed
- _S6_u8 0x0012fc34 "" unsigned char [16]
[0x0] 0x00 unsigned char
[0x1] 0x00 unsigned char
[0x2] 0x00 unsigned char
[0x3] 0x00 unsigned char
[0x4] 0x00 unsigned char
[0x5] 0x00 unsigned char
[0x6] 0x00 unsigned char
[0x7] 0x00 unsigned char
[0x8] 0x00 unsigned char
[0x9] 0x00 unsigned char
[0xa] 0x00 unsigned char
[0xb] 0x00 unsigned char
[0xc] 0x00 unsigned char
[0xd] 0x00 unsigned char
[0xe] 0x00 unsigned char
[0xf] 0x00 unsigned char
+ _S6_u16 0x0012fc34 "" unsigned short [8]
+ _S6_u32 0x0012fc34 unsigned int [4]
+ _S6_u64 0x0012fc34 unsigned __int64 [2]
scope_id 0x00000000 unsigned int
Thank you.
-hb-
_______________________________________________
Mozilla-netlib mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-netlib