コード例 #1
0
ファイル: Utils.cs プロジェクト: hex11/Naive
 public Listener(IAdapter adapter, TcpListener baseListener)
 {
     Adapter      = adapter;
     BaseListener = baseListener;
     if (adapter != null)
     {
         Logger.ParentLogger = adapter.GetAdapter().Logger;
     }
 }
コード例 #2
0
        public static async Task <ConnectResult> Connect(IAdapter adapter, AddrPort dest, int timeoutSeconds)
        {
            Socket socket;

            try {
                socket = await NaiveUtils.ConnectTcpAsync(dest, timeoutSeconds * 1000);
            } catch (Exception e) {
                return(new ConnectResult(adapter, ConnectResultEnum.Failed)
                {
                    FailedReason = e.Message,
                    Exception = e
                });
            }
            return(new ConnectResult(adapter, MyStream.FromSocket(socket, adapter.GetAdapter().socket_impl)));
        }
コード例 #3
0
ファイル: InConnection.cs プロジェクト: hex11/Naive
        protected InConnection(IAdapter creator) : base(creator)
        {
            var adap = creator.GetAdapter();

            BytesCountersRW = new BytesCountersRW(adap.BytesCountersRW);
        }