コード例 #1
0
        internal BufferedReceiveOverSingleStreamSocket(SingleStreamSocket underlying, int bufferSize = 256)
        {
            Underlying = underlying;

            // The _buffer data member holds the buffered data. There's no buffered data until we receive data
            // from the underlying socket so the array segment point to an empty segment.
            _buffer = new ArraySegment <byte>(new byte[bufferSize], 0, 0);
        }
コード例 #2
0
ファイル: TcpConnector.cs プロジェクト: cyyever/ice
        public Connection Connect(string connectionId, bool preferNonSecure)
        {
            SingleStreamSocket socket = _endpoint.CreateSocket(this, _addr, _proxy, preferNonSecure);

            MultiStreamOverSingleStreamSocket multiStreamSocket = _endpoint.Protocol switch
            {
                Protocol.Ice1 => new Ice1NetworkSocket(socket, _endpoint, null),
                _ => new SlicSocket(socket, _endpoint, null)
            };

            return(_endpoint.CreateConnection(_endpoint.Communicator.OutgoingConnectionFactory,
                                              multiStreamSocket,
                                              this,
                                              connectionId,
                                              null));
        }
コード例 #3
0
ファイル: SslSocket.cs プロジェクト: mreinart/ice
 // Only for use by TcpEndpoint.
 internal SslSocket(
     Communicator communicator,
     SingleStreamSocket underlying,
     string hostOrAdapterName,
     bool incoming)
 {
     _communicator = communicator;
     _engine       = communicator.SslEngine;
     _underlying   = underlying;
     _incoming     = incoming;
     if (_incoming)
     {
         _adapterName = hostOrAdapterName;
     }
     else
     {
         _host = hostOrAdapterName;
     }
 }
コード例 #4
0
ファイル: SslSocket.cs プロジェクト: cyyever/ice
 // Only for use by TcpEndpoint.
 internal SslSocket(
     Communicator communicator,
     SingleStreamSocket underlying,
     string hostOrAdapterName,
     bool incoming,
     IConnector?connector = null)
 {
     Debug.Assert(incoming || connector != null);
     _communicator = communicator;
     _connector    = connector;
     _engine       = communicator.SslEngine;
     _underlying   = underlying;
     _incoming     = incoming;
     if (_incoming)
     {
         _adapterName = hostOrAdapterName;
     }
     else
     {
         _host = hostOrAdapterName;
     }
 }