Socket.getPort(); // 获取客户端的端口
Socket.getInetAddress(); //获取客户端的地址信息返回InetAddress对象
Socket.getInetAddress(); //获取客户端的地址信息返回InetAddress对象
本文介绍了如何使用Socket API 获取客户端的地址信息(InetAddress对象)和端口号。这对于理解网络编程的基本原理非常重要。

被折叠的 条评论
为什么被折叠?