diff --git a/Foundation Web Core/src/com/foundation/web/server/WebServer.java b/Foundation Web Core/src/com/foundation/web/server/WebServer.java index 0ac5862..cabd561 100644 --- a/Foundation Web Core/src/com/foundation/web/server/WebServer.java +++ b/Foundation Web Core/src/com/foundation/web/server/WebServer.java @@ -1934,7 +1934,7 @@ public class WebServer { * @see com.foundation.web.server.WebServer.AbstractSocketContext#hasPendingWrite() */ protected boolean hasPendingWrite() { - return pendingOutboundMessage != null; + return pendingOutboundMessage != null || (encryptedWriteBuffer != null && encryptedWriteBuffer.hasRemaining()); }//hasPendingWrite()// /* (non-Javadoc) * @see com.foundation.web.interfaces.IConnectionContext#upgradeToWebsocket(java.lang.String, long, com.foundation.web.interfaces.WebsocketHandler) @@ -2252,8 +2252,8 @@ public class WebServer { synchronized(selectionKey) { if(selectionKey.isValid()) { //Always flag the socket for reading, only flag the socket for writing if a pending write operation exists.// - //selectionKey.interestOps(SelectionKey.OP_READ | (((AbstractSocketContext) context).hasPendingWrite() ? SelectionKey.OP_WRITE : 0)); - selectionKey.interestOps(((AbstractSocketContext) context).flags); + selectionKey.interestOps(SelectionKey.OP_READ | (((AbstractSocketContext) context).hasPendingWrite() ? SelectionKey.OP_WRITE : 0)); + //selectionKey.interestOps(((AbstractSocketContext) context).flags); }//if// else { Debug.log(new RuntimeException("Woops! Somehow the selection key isn't valid, but the socket isn't closed either!"));