Socket Programming: (General network programming)
<1> two JAVA applications can exchange data through a two-way network communication connection, a section of this bidirectional link is called a Socket.
<2> sockets are commonly used to implement client-server connections.
The two class sockets and serversocket (blocking) defined in the <3> java.net package are used to implement both the client and Server side of the two-way connection.
<4> when establishing a connection, the required addressing information is the IP address and port number of the remote computer (port number, 2 bytes, 65,536 ports, one application may have multiple port numbers)
TCP port, UDP port separate, technically speaking, only TCP want $ Server, Client.
Each has 65,536 ports, the port number is used to distinguish between different applications on the same machine, a person occupies a certain port number, others can not be accounted for.
Write your own program, account for 1024 after the port number, 1024 before the occupation, the system may be ready to requisition.
TCP and UDP are not the same.
<5> Default Web page HTTP port is 80 port;
SMTP (mail send): 25 port
POP3 (Incoming mail): 110 port
<6> Write TCPServer, TCPclient program, first start the Server, and then start the Client, while writing programs, developed together.
Network Programming in Java-2