public Listener(IAdapter adapter, TcpListener baseListener) { Adapter = adapter; BaseListener = baseListener; if (adapter != null) { Logger.ParentLogger = adapter.GetAdapter().Logger; } }
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))); }
protected InConnection(IAdapter creator) : base(creator) { var adap = creator.GetAdapter(); BytesCountersRW = new BytesCountersRW(adap.BytesCountersRW); }