Ejemplo n.º 1
0
    public byte[] GetRawBuffer(bool FinalPacket)
    {
        HeaderFrame = new WebSocketHeaderFrame
        {
            FIN           = FinalPacket ? 1 : 0,
            OpCode        = PayloadOpCode,
            MASK          = 0,
            PayloadLength = PayloadData.Length,
            RSV1          = 0,
            RSV2          = 0,
            RSV3          = 0
        };
        PayloadData = Encoding.Default.GetString(HeaderFrame.Serilize()) + Encoding.UTF8.GetString(Encoding.Default.GetBytes(PayloadData));

        return(Encoding.Default.GetBytes(PayloadData));
    }
Ejemplo n.º 2
0
 public WebSocketFrame(byte[] Header, Socket ClientSocket)
 {
     HeaderFrame = new WebSocketHeaderFrame();
     HeaderFrame.Deserilize(Header, ClientSocket);
 }