Exemplo n.º 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;
 }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 public HttpClientProtocol(ConnectionContext connection)
 {
     _connection = connection;
     _reader     = connection.CreateReader();
 }
Exemplo n.º 4
0
 public HttpBodyStream(ProtocolReader reader, IMessageReader <ReadOnlySequence <byte> > bodyReader)
 {
     _reader     = reader;
     _bodyReader = bodyReader;
 }