Welcome![Sign In][Sign Up]
Location:
Downloads SourceCode Windows Develop Communication
Title: UDP.rar Download
 Description: 1, you first need to define the object: the SOCKET ReceivingSocket // the the receiving end Socket SOCKADDR_IN distant ReceiverAddr // the receiving end the address information char ReceiveBuf of [1024] /​ ​ / receive data buffer size int BufLength // buffer length SOCKADDR_IN distant SenderAddr // send data end address information int SenderAddrSize = sizeof (SenderAddr) // length of the address information of the sender, start WSA dynamic library: the WSAStartup (MAKEWORD (2,2), & wsd) 3, create socket: ReceivingSocket = socket ( AF_INET, SOCK_DGRAM, IPPROTO_UDP) initialize server address and listen port ReceiverAddr.sin_family = AF_INET //family ReceiverAddr.sin_port = htons (9000) //set port number ReceiverAddr.sin_addr.s_addr = htonl (INADDR_ANY) //address 5, binding port 6 the the receiver Data: ReceivingSocket,// ​ ​ receiving end the the Socket ReceiveBuf,// ​ ​ receiving end is used to store data buffer BufLength// buffer size 0,// ​
 To Search:
File list (Check if you may need any files):

CodeBus www.codebus.net