12. TCP / IP
TCP / IP will communicate through objects and ClientSocket ServerSocket.
To make a submission, the Sockets on both computers must use the same communications port, must be careful not to activate a port used by the operating system or some service that may be running on any computers. Do not use standard ports for Internet services.
To make a communication between two computers through TCP / IP sockets have it follow the following steps:
- Put the computer that represents the server on listening (Listening).
- From the client computer to connect indicating the Host or IP of the server computer.
- Ved established a connection (without any errors occur) can initiate communication by sending data from client to server.
- Process customer data in the server.
- Responding to the customer.
- Process the response data, and continue the communication of information by repeating steps 3 through 6. When connection is established, any client machine / server is capable of sending data, so that both can initiate a communication.
- To stop communications, the connection is closed by the client.
- To stop the server, the exit mode of listening (Listening).
TCP/IP by means of socket communications