0
我正在嘗試使用Haxe中的sys.net.UdpSocket庫進行UDP連接。Haxe sys.net.UdpSocket錯誤:自定義(std @ socket_recv_from)
服務器:節點JS
客戶:HAXE()
var udpsocket:UdpSocket = new UdpSocket();
var addr:Address = new Address();
addr.host = new Host("127.0.0.1").ip;
addr.port = 36000;
while(true){
try{
var bf:Bytes = Bytes.alloc(2048);
var length:Int = udpsocket.readFrom(bf, 0, bf.length, addr); // Error happens here
var msg:String = bf.getString(0, length);
}
catch (e:Dynamic) {
trace(e);
}
}
在udpsocket.readFrom(..)線,
計劃拋出:自定義(STD @ socket_recv_from)