// For testing public LibuvTransport(LibuvFunctions uv, LibuvTransportContext context, IEndPointInformation endPointInformation) { Libuv = uv; TransportContext = context; _endPointInformation = endPointInformation; }
public ITransport Create(IEndPointInformation endPointInformation, IConnectionDispatcher dispatcher) { var transportContext = new LibuvTransportContext { Options = _baseTransportContext.Options, AppLifetime = _baseTransportContext.AppLifetime, Log = _baseTransportContext.Log, ConnectionDispatcher = dispatcher }; return(new LibuvTransport(transportContext, endPointInformation)); }
public LibuvTransportFactory( IOptions <LibuvTransportOptions> options, IApplicationLifetime applicationLifetime, ILoggerFactory loggerFactory) { if (options == null) { throw new ArgumentNullException(nameof(options)); } if (applicationLifetime == null) { throw new ArgumentNullException(nameof(applicationLifetime)); } if (loggerFactory == null) { throw new ArgumentNullException(nameof(loggerFactory)); } var logger = loggerFactory.CreateLogger("RaySocket.Transport.Libuv"); var trace = new LibuvTrace(logger); var threadCount = options.Value.ThreadCount; if (threadCount <= 0) { throw new ArgumentOutOfRangeException(nameof(threadCount), threadCount, "ThreadCount must be positive."); } if (!LibuvConstants.ECONNRESET.HasValue) { trace.LogWarning("Unable to determine ECONNRESET value on this platform."); } if (!LibuvConstants.EADDRINUSE.HasValue) { trace.LogWarning("Unable to determine EADDRINUSE value on this platform."); } _baseTransportContext = new LibuvTransportContext { Options = options.Value, AppLifetime = applicationLifetime, Log = trace, }; }
public Listener(LibuvTransportContext transportContext) : base(transportContext) { }
public ListenerContext(LibuvTransportContext transportContext) { TransportContext = transportContext; }
public LibuvTransport(LibuvTransportContext context, IEndPointInformation endPointInformation) : this(new LibuvFunctions(), context, endPointInformation) { }
public ListenerSecondary(LibuvTransportContext transportContext) : base(transportContext) { _ptr = Marshal.AllocHGlobal(4); }