[英]DatagramPacket Constructor not found
The following code produces "no suitable constructor found" error. 以下代码生成“找不到合适的构造函数”错误。 I am unable to figure out a reason. 我无法弄清楚原因。
try {
Sock = new DatagramSocket();
InetAddress IP_add=InetAddress.getByName("192.168.1.2");
DatagramPacket PACKET=new DatagramPacket(buf,buf.length,IP_add,2000);
} catch (Exception e) {}
There are e few options 有几个选择
byte []
你的buf实例不是byte的数组,必须是byte []
Recheck it, I think the first point will help you. 重新检查一下,我认为第一点会对你有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.