Socket was blocked need help

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()));
            
        }
	}

image

/**
		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!

If it’s a local socket, do you have something on the other side reading it? Sockets usually block when their buffers fill.

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

Hi!
Commentary on the method says that a non-blocking socket will abort blocking operations immediately by throwing a haxe.io.Error.Blocking value.

It should be true by default, but maybe something is broken, so… Try to set blocking to true, not false. Like this: socket.setBlocking(true);