Joke Collection Website - Public benefit messages - Under linux, the socket server and the client are connected through TCP. How to get them to send messages to each other?

Under linux, the socket server and the client are connected through TCP. How to get them to send messages to each other?

1. It may be that there is a problem in processing when obtaining the ip and port of the client, which makes it impossible to send it to the client correctly.

2. Whether the client uses a fixed port to receive server information, or whether the server sends it to the corresponding port of the client correctly.

3. Through the above analysis, it is likely that there is something wrong with the processing port, please check again.

4. In fact, it is best to catch the error message by throwing an exception, or analyze the data sending process through step-by-step debugging.