Question

I have 4 different application running.so every application can send data to server. now i want to send data to paticular socket (server and client are done through socket programming) from server side.

Was it helpful?

Solution

When you create a socket, first you establish a connection between a server and a client (using connect system call on the client side, and bind, listen, and accept system calls on the server side). You can have many such connections, from a server to different clients. The server can send data on any of these established connections.

The Sockets Tutorial can assist you in this case.


If you want multiple reads/writes by the server to happen at the same time, you have to use non-blocking sockets or multiple threads.

OTHER TIPS

(Assuming you're using TCP/IP, or UDP).

A socket endpoint is the IP address and port number combined. So, on your host you would have your various servers listen on different port numbers. For example a web server may listen on port 80, ssh on a different port etc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top