UDP in C ++ on Linux

How to send and receive using UDP in C ++ on Linux? I am using g ++

+4
source share
3 answers

Ok, that’s easy. I worked on CentOS 5.5, which is linux, and I am doing an udp server-client program in c.It works well.

The procedure is simple. It follows that ...

**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 this does not work, go to β†’ matrixsust.blogspot.com for the source.

+3
source
+3
source

You can use the Berkeley Sockets API .

+3
source

All Articles