满意答案
audio111425
推荐于 2016.04.12
采纳率:54% 等级:12
已帮助:5097人
char buff2[1024*10];
int receiveLen;
/*调用accept函数,等待客户端的连接*/
client_fd=accept(sockfd,(struct sockaddr *)&client_sockaddr,&sin_size
/*调用recv函数接收客户端的请求*/
recvbytes=recv(client_fd,buf,BUFFER_SIZE,0)
typedef int (WINAPI ICEPUB_TCPSENDANDRECEIVETEXT)(char *sendBuff, int sendBuffLen,char *recvBuff,int recvMaxLen,char* serverIP,int serverPort);
ICEPUB_TCPSENDANDRECEIVETEXT *icePub_tcpSendAndReceiveText = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_tcpSendAndReceiveText=(ICEPUB_TCPSENDANDRECEIVETEXT *)GetProcAddress(hDLLDrv,"icePub_tcpSendAndReceiveText");
}
if(icePub_tcpSendAndReceiveText)
receiveLen=icePub_tcpSendAndReceiveText(buf,recvbytes),buff2,1024*10,"192.168.1.2",8000);
if(hDLLDrv)
FreeLibrary(hDLLDrv);
AfxMessageBox(buff2);
00分享举报