int nlen=sizeof(sact);
memcpy(sendbuf,(char*)&sact,sizeof(sendbuf));
int nlenm=sizeof(sendbuf);
int nlenn=sendto(socketMul,sendbuf,nlenm,0,(SOCKADDR*)&addrMul,sizeof(addrMul));
char recvbuf[1024];
if(nlenn>0)
{
printf("success send sock\n");
//closesocket(socketMul);
//Sleep(1000);
while(1)
{
int len=sizeof(addrMul);
int mlen=strlen(recvbuf);
int nret=recvfrom(socketMul,recvbuf,strlen(recvbuf),0,(SOCKADDR*)&addrMul,&len);
if(nlen>0)
{
printf("success recv sock\n");
closesocket(socketMul);
WSACleanup();
break;
请高手指点一下!!!
1 个解决方案
#1
请问楼主问题解决了
#1
请问楼主问题解决了