Example #1
0
 private HubProtocol(ConnectionContext connection, int?maximumMessageSize, IHubProtocol hubProtocol, IInvocationBinder invocationBinder)
 {
     _connection         = connection;
     _protocolReader     = connection.CreateReader();
     _protocolWriter     = connection.CreateWriter();
     _hubMessageReader   = new HubMessageReader(hubProtocol, invocationBinder);
     _hubMessageWriter   = new HubMessageWriter(hubProtocol);
     _maximumMessageSize = maximumMessageSize;
 }
Example #2
0
        public HttpClientProtocol(ConnectionContext connection)
        {
            _connection = connection;
            _reader     = connection.CreateReader();

            (string host, int port) = connection.RemoteEndPoint switch
            {
                UriEndPoint uriEndPoint => (uriEndPoint.Uri.Host, uriEndPoint.Uri.Port),
                IPEndPoint ip => (ip.Address.ToString(), ip.Port),
                _ => throw new NotSupportedException($"{connection.RemoteEndPoint} not supported")
            };
            _messageWriter = new Http1RequestMessageWriter(host, port);
        }
Example #3
0
 public HttpClientProtocol(ConnectionContext connection)
 {
     _connection = connection;
     _reader     = connection.CreateReader();
 }
 public HttpBodyStream(ProtocolReader reader, IMessageReader <ReadOnlySequence <byte> > bodyReader)
 {
     _reader     = reader;
     _bodyReader = bodyReader;
 }