网络编程
网络模型(OSI(Open System Interconnect)开放式系统互联,见osi文件)
查看端口:netstat -a
-n
UDP(用户数据报协议,不可靠传输)
TCP(传输控制协议,可靠传输)
InetAddress (InetAddress );(开外网测试方便)
static InetAddress[] getAllByName(Stringhost)
static InetAddress getByAddress(byte[]addr)
static InetAddress getByAddress(String host, byte[]addr)
static InetAddress getByName(Stringhost)
域名解析:
本地的域名解析文件
EX:
InetAddress
ip =InetAddress.getByName("192.168.0.3");
System.out.print(ip.getHostAddress());
System.out.print(ip.getHostName());
UDP(DatagramPacket ,DatagramSocket )
tcp(ServerSocket ,Socket )