UDP in C++ in Linux [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this questionHow to send and receive, using UDP, in C++ in Linux? I use g++
Ok it's preety simple. I was workig in CentOS 5.5 which is linux and i make a server-client programme based on udp in c.It runs well.
The procedure is simple. It follows as ..
**SERVER**
0.Variable initialization
1.sock()
2.bind()
3.recvfrom()
4.sendto()
**CLIENT**
0.gethostbyname()
1.sock()
2.bzero()
4.sendto()
5.recvfrom()
You will understand the code if you see the documentation.
If its not work that way then go to >> matrixsust.blogspot.com for source.
Using boost::asio.
You can use Berkeley Sockets API.
精彩评论