Introduction - If you have any usage issues, please Google them yourself
Experiment 3 TCP and UDP sockets integrated application
Requirements: (1) TCP, UDP
(2) C/S
(3) multi-threaded programming
Abstract: Designing a simple client/server, concurrent UDP communication while responding to customer requirements, but also to respond to the client sent, TCP communication requirements.
TCP Client:
Create a stream socket client initiates TCP connection to the server.
After the connection is successfully created, sustained over a socket send or receive data to the server.
(3) Input or receiving the command end , the end of the send and receive data, and disconnect the server.
UDP Client:
(1) client creates a datagram socket, issuing a time command to the server via the socket for the server system time.
(2) receives the server returns the time, update the client system time.
(3) Disconnect the server.
Server:
For TCP client, the services provided are