Thursday 26 February 2015

TCP socket programming basic

- Server:
1. Create a socket with the socket()
2. Bind the socket to an address using the bind( )
3. Listen for connections with the listen()
4. Accept a connection with the accept
5. Send and receive data, use the read() and write() system calls

-Client:
1. Create a socket with the socket()
2. Connect the socket to the address of the server using the connect() system call.
3. Send and receive data, use the read() and write() system calls.

 

No comments:

Post a Comment