good lord what a pain network programming is to learn.
:?
Anyway, although this is not a general programming board, I will try and be brief. Attached is a server client udp example written with winsock (Not winsock2, there is a difference) and should be linked with libwsock32.a
I am using MingW, hence the a.
Hope it helps.
EDIT: PS Not an expert at this. But a very cool way to "poll" for data in the UDP socket is:
int udpNetworkStack::pollSocketQue()
{
timePortDelay.tv_sec = 0;
timePortDelay.tv_usec = 0;
select(SocketDescriptor+1,&SocketFileDescriptorSet,NULL,NULL,&timePortDelay);
if (FD_ISSET(SocketDescriptor,&SocketFileDescriptorSet))
{
bytesReceived = recvfrom(SocketDescriptor, ReadPacket, PacketSize, 0, (struct sockaddr*)&ClientInformation.networkInformation, &clientLength);
//Add all the network packets in the que to the linklist
return(1);
}
return(0);
}
[attachment deleted by admin]