socket was blocked need help.
hello ,what I want to know why my socket was blocked ?
same code and difference result?
public static function WriteMessage(socket:Socket,msg:protohx.Message){
try{
var bytes = msgToBytes(msg);
socket.output.writeByte(90);
socket.output.writeByte(72);
socket.output.writeByte(89);
socket.output.writeByte(1);
socket.output.writeByte(0);
socket.output.writeByte(0);
socket.output.writeInt32(bytes.length);
socket.output.write(bytes)**;//here will throw socket block error in
// my other server.but My server do not show this blocked**
socket.output.flush();
trace("finish");
}catch(e:Dynamic){
trace("error"+e+"\n");
trace(haxe.CallStack.toString(haxe.CallStack.exceptionStack()));
}
}
/**
Change the blocking mode of the socket. A blocking socket is the default behavior. A non-blocking socket will abort blocking operations immediately by throwing a haxe.io.Error.Blocking value.
**/
function setBlocking( b : Bool ) : Void;
I was setBlocking(false);//but not work,still throw Blocked error!
how to get buffers 's length to check if it’s fill? or check other side reading ? I 'm sure there is only one
flush() ,there are no other reading. because only one client connect.
I test in my local server ,there are no blocked error,but when I upload to remote server ,it’s alway blocked. @ebishton