服务端启动后 客户端就不能用本机地址了呢
关于UDP这章 为什么我的eclipse在服务端启动后 客户端就不能用本机地址了呢
之前的TCP 就没有这种问题呀
我仔细核对了一下自己和老师的代码 并且尝试把老师的代码黏贴过来还是不能启动客户端
错误信息如下
Exception in thread "main" java.net.BindException: Address already in use: Cannot bind
at java.net.DualStackPlainDatagramSocketImpl.socketBind(Native Method)
at java.net.DualStackPlainDatagramSocketImpl.bind0(Unknown Source)
at java.net.AbstractPlainDatagramSocketImpl.bind(Unknown Source)
at java.net.DatagramSocket.bind(Unknown Source)
at java.net.DatagramSocket.<init>(Unknown Source)
at java.net.DatagramSocket.<init>(Unknown Source)
at java.net.DatagramSocket.<init>(Unknown Source)
at procs.SerDatagramPacket.main(SerDatagramPacket.java:12)