basic socket programming

Hello experts,
four machines need to communicate with each other. How can I start the socket programming. Can you please explain me more elaborated way.

Thank you for your time and effort in advance

Why would you post a question like this without searching first?

Is this homework?

No, I have read some articles about socket programming. When I specify the destination address is one destination address is enough or I need to provide 3 destination address

You can't generally give more than one destination. You can broadcast, but that's done with a special address which makes it still just one address programming-wise.

Do you want stream sockets or packet ones? Stream sockets are used like files... write data on one side of the connection, read on the other, and vice versa. The internet uses TCP/IP for stream sockets.

Packet sockets send individual messages one at a time, in packets of a small maximum size. Each individual packet can have a different recipient, and each socket can receive from anyone. The internet uses UDP for this.

Probably easier for him to deal with stream sockets at first.

Without knowing exactly what you're trying to do, first recommendation would be to set up a server/client architecture. It's simple, straightforward, and there should be a million tutorials on the web about it.