Java socket programming example (I) – basic use of TCP

I Server code:

II Client code:

The TCP server of the above code is a single thread and can only serve one client at a time.

For more Java syntax, you can pay attention to: Thinking in JAVA Chinese manual, JDK 1.7 reference manual official English version, JDK 1.6 API JAVA Chinese reference manual, JDK 1.5 API JAVA Chinese reference manual. I also hope you can support more programming skills.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>