Exemple #1
0
        WSTransceiver(ProtocolInstance instance, Transceiver del, string host, int port, string resource)
        {
            init(instance, del);
            _host = host;
            _port = port;
            _resource = resource;
            _incoming = false;

            //
            // For client connections, the sent frame payload must be
            // masked. So we copy and send the message buffer data in
            // chuncks of data whose size is up to the write buffer
            // size.
            //
            Socket fd = del.fd();
            _writeBufferSize = Math.Max(Network.getSendBufferSize(fd), 1024);

            //
            // Write and read buffer size must be large enough to hold the frame header!
            //
            Debug.Assert(_writeBufferSize > 256);
            Debug.Assert(_readBufferSize > 256);
        }