有关ISOCKET_SetOpt问题老是调用失败
nntt 2009-10-26 09:20:59 if ( ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_NET, (void**)(&pMe->m_pNetMgr)) != SUCCESS )
{
return FALSE;
}
pMe->addrGroup = x_ConvertToAddr( "234.5.6.7" );
pMe->port = HTONS(4567);
pMe->m_pSock = INETMGR_OpenSocket( pMe->m_pNetMgr, AEE_SOCK_DGRAM );
OptNetwork( pMe );
static void OptNetwork(sockdemo* pMe) {
int retVal;
retVal = ISOCKET_SetOpt( pMe->m_pSock, AEE_IPPROTO_IP, AEE_IP_ADD_MEMBERSHIP, (const void*)&pMe->addrGroup, sizeof( pMe->addrGroup ) ) ;
// Check the return value of ISOCKET_Bind() and display necessary message
switch(retVal) {
// Socket not ready yet
case AEE_NET_WOULDBLOCK:
ISOCKET_Writeable(pMe->m_pSock, (PFNNOTIFY)OptNetwork, pMe);
break;
// Succesfully connected
case AEE_NET_SUCCESS:
SetUpNetwork( pMe );
break;
// Something went wrong, print error to logger
default:
DBGPRINTF("retVal %d", ISOCKET_GetLastError(pMe->m_pSock));
break;
}
}
为什么调用老失败,我想模拟局域网广播