gujiakai-top

Java自学-网络编程(2)

1、网课截图

1.1 端口

image-20210801185927455

Ctrl+Shift+Esc:打开任务管理器

image-20210801191307236

package lesson01;

import java.net.InetSocketAddress;

/**
 * Author: Gu Jiakai
 * Date: 2021/8/1 19:05
 * FileName: TestInetSocketAddress
 * Description:
 */
public class TestInetSocketAddress {
    public static void main(String[] args) {
        InetSocketAddress inetSocketAddress = new InetSocketAddress("127.0.0.1", 8080);
        InetSocketAddress inetSocketAddress2 = new InetSocketAddress("localhost", 8080);
        System.out.println(inetSocketAddress);
        System.out.println(inetSocketAddress2);

        System.out.println(inetSocketAddress.getAddress());
        System.out.println(inetSocketAddress.getHostName());//地址。
        System.out.println(inetSocketAddress.getPort());//端口。

    }
}

1.2 通信协议

image-20210801192734067

image-20210801193617846

image-20210801193642112

分类:

技术点:

相关文章:

  • 2021-07-12
  • 2022-01-08
  • 2021-10-24
  • 2021-05-31
  • 2022-03-06
  • 2021-07-22
  • 2021-11-18
  • 2022-01-21
猜你喜欢
  • 2021-07-14
  • 2022-02-03
  • 2021-07-14
  • 2021-09-18
  • 2022-12-23
  • 2021-09-24
相关资源
相似解决方案