2019年Java网络编程精解.pptVIP

  • 1
  • 0
  • 约7.22千字
  • 约 29页
  • 2019-03-04 发布于天津
  • 举报
Java网络编程精解 作者:孙卫琴 参考书籍:Java网络编程精解 技术支持网址: 第3章 ServerSocket用法详解 3.1 构造ServerSocket 3.2 接收和关闭与客户的连接 3.3 关闭ServerSocket 3.4 获取ServerSocket的信息 3.5 ServerSocket选项 3.6 创建多线程的服务器 3.7 关闭服务器 3.1 构造ServerSocket ServerSocket的构造方法有以下几种重载形式: (1)ServerSocket()throws IOException (2)ServerSocket(int port) throws IOException (3)ServerSocket(int port, int backlog) throws IOException (4)ServerSocket(int port, int backlog, InetAddress bindAddr) throws IOException 3.1.1 绑定端口 ServerSocket serverSocket=new ServerSocket(80); 如果运行时无法绑定到80端口,以上代码会抛出IOException,更确切的说,是抛出BindException,它是IOEx

文档评论(0)

1亿VIP精品文档

相关文档