示例#1
0
 public static IWebSocketPacket TokenToPacket(string aFormat, IToken aToken)
 {
     if (aFormat.Equals(WebSocketConstants.WS_FORMAT_JSON))
     {
         return(JSONTokenProcessor.TokenToPacket(aToken));
     }
     else if (aFormat.Equals(WebSocketConstants.WS_SUBPROT_CSV))
     {
         throw new NotImplementedException(WebSocketMessage.NOT_IMPLEMENTED_YET);
     }
     else if (aFormat.Equals(WebSocketConstants.WS_FORMAT_XML))
     {
         throw new NotImplementedException(WebSocketMessage.NOT_IMPLEMENTED_YET);
     }
     return(null);
 }
示例#2
0
 public IWebSocketPacket TokenToPacket(IToken aToken)
 {
     if (mNegotiatedSubProtocol.SubProtocol.Equals(WebSocketConstants.WS_SUBPROT_JSON))
     {
         return(JSONTokenProcessor.TokenToPacket(aToken));
     }
     else if (mNegotiatedSubProtocol.Equals(WebSocketConstants.WS_SUBPROT_CSV))
     {
         throw new NotImplementedException(WebSocketMessage.NOT_IMPLEMENTED_YET);
     }
     else if (mNegotiatedSubProtocol.Equals(WebSocketConstants.WS_FORMAT_XML))
     {
         throw new NotImplementedException(WebSocketMessage.NOT_IMPLEMENTED_YET);
     }
     return(null);
 }