private void error ( ErrorReason error ) { if ( options . rawSocket ) { // For raw sockets, send a final 0-length message to the application // so that it knows the peer has been disconnected. Msg terminator = new Msg ( ) ; processMsg . apply ( terminator ) ; } assert ( session != null ) ; socket . eventDisconnected ( endpoint , fd ) ; session . flush ( ) ; session . engineError ( error ) ; unplug ( ) ; destroy ( ) ; }
Function to handle network disconnections .