Hi!
I'm new to winsock.
I want two computer to communicata with UDP .
But wen I run the receiver program ,there will be always a error.
the errorcode is 10014 (invalid address)
the receiver can receive the event FD_READ
but when i use WSARecvFrom ,nothing can be read .
Even more the receiver will receive the event FD_READ again and again ,
Can you tell me why?

the code :

sender:

m_addr.sin_addr.s_addr=inet_addr(m_faraddr);
m_addr.sin_family=AF_INET;
m_addr.sin_port=htons(20001);

m_localaddr.sin_addr.s_addr=INADDR_ANY;
m_localaddr.sin_port=htons(10001);
m_localaddr.sin_family=AF_INET;

WSABUF wsaBuf;
wsaBuf.len=strMsg.GetLength();
wsaBuf.buf=strMsg.GetBuffer(wsaBuf.len);
int i=0;
iRetCode=WSASendTo(m_socket,&wsaBuf,1,(DWORD*)&i,0,(SOCKADDR*)&m_addr,sizeof(SOCKADDR),NULL,NULL);



receiver:


m_faraddr.sin_addr.s_addr=inet_addr(m_addr);
m_faraddr.sin_family=AF_INET;
m_faraddr.sin_port=htons(10001);
m_localaddr.sin_addr.s_addr=INADDR_ANY;
m_localaddr.sin_port=htons(20001);
m_localaddr.sin_family=AF_INET;

m_socket=WSASocket(AF_INET,SOCK_DGRAM,0,NULL,0,WSA_FLAG_MULTIPOINT_C_LEAF|WSA_FLAG_MULTIPOINT_D_LEAF);
.........................
char buffer[0x1000];
int iRet=0;
DWORD ret=0;
int iLen=sizeof(m_addr);
int iFlag=0;
WSABUF wsaRecvBuf;
wsaRecvBuf.len=0x1000;
wsaRecvBuf.buf=buffer


iRet=WSARecvFrom(m_socket,&wsaRecvBuf,1 ,&ret,0,(SOCKADDR*)&m_faraddr,&iLen,NULL,NULL);
/////here ret is always 0 and errorcode is 10014

please help me!!!!