protected override void DoSetAll(IoSessionConfig config) { IDatagramSessionConfig cfg = config as IDatagramSessionConfig; if (cfg == null) { return; } if (cfg.EnableBroadcast.HasValue) { EnableBroadcast = cfg.EnableBroadcast; } if (cfg.ReceiveBufferSize.HasValue) { ReceiveBufferSize = cfg.ReceiveBufferSize; } if (cfg.SendBufferSize.HasValue) { SendBufferSize = cfg.SendBufferSize; } if (cfg.ReuseAddress.HasValue) { ReuseAddress = cfg.ReuseAddress; } if (cfg.TrafficClass.HasValue) { TrafficClass = cfg.TrafficClass; } if (cfg.ExclusiveAddressUse.HasValue) { ExclusiveAddressUse = cfg.ExclusiveAddressUse; } MulticastOption = cfg.MulticastOption; }
protected override void DoSetAll(IoSessionConfig config) { ISocketSessionConfig cfg = config as ISocketSessionConfig; if (cfg == null) return; if (cfg.ReceiveBufferSize.HasValue) ReceiveBufferSize = cfg.ReceiveBufferSize; if (cfg.SendBufferSize.HasValue) SendBufferSize = cfg.SendBufferSize; if (cfg.ReuseAddress.HasValue) ReuseAddress = cfg.ReuseAddress; if (cfg.TrafficClass.HasValue) TrafficClass = cfg.TrafficClass; if (cfg.ExclusiveAddressUse.HasValue) ExclusiveAddressUse = cfg.ExclusiveAddressUse; if (cfg.KeepAlive.HasValue) KeepAlive = cfg.KeepAlive; if (cfg.OobInline.HasValue) OobInline = cfg.OobInline; if (cfg.NoDelay.HasValue) NoDelay = cfg.NoDelay; if (cfg.SoLinger.HasValue) SoLinger = cfg.SoLinger; }
protected override void DoSetAll(IoSessionConfig config) { ISerialSessionConfig cfg = config as ISerialSessionConfig; if (cfg != null) { ReadTimeout = cfg.ReadTimeout; WriteBufferSize = cfg.WriteBufferSize; ReceivedBytesThreshold = cfg.ReceivedBytesThreshold; } }
public SocketContext(System.Net.Sockets.Socket socket, IoSessionConfig config) { _socket = socket; _completeHandler = OnCompleted; Byte[] writeBuffer = new Byte[config.ReadBufferSize]; _writeBuffer = SocketAsyncEventArgsBufferAllocator.Instance.Wrap(writeBuffer); _writeBuffer.SocketAsyncEventArgs.Completed += new EventHandler<SocketAsyncEventArgs>(OnCompleted); _writeBuffer.SocketAsyncEventArgs.UserToken = this; }
public void SetAll(IoSessionConfig config) { if (config == null) throw new ArgumentNullException(nameof(config)); ReadBufferSize = config.ReadBufferSize; ThroughputCalculationInterval = config.ThroughputCalculationInterval; ReaderIdleTime = config.ReaderIdleTime; WriterIdleTime = config.WriterIdleTime; BothIdleTime = config.BothIdleTime; WriteTimeout = config.WriteTimeout; }
public SocketContext(System.Net.Sockets.Socket socket, IoSessionConfig config) { _socket = socket; _completeHandler = OnCompleted; Byte[] writeBuffer = new Byte[config.ReadBufferSize]; _writeBuffer = SocketAsyncEventArgsBufferAllocator.Instance.Wrap(writeBuffer); _writeBuffer.SocketAsyncEventArgs.Completed += new EventHandler <SocketAsyncEventArgs>(OnCompleted); _writeBuffer.SocketAsyncEventArgs.UserToken = this; }
protected override void DoSetAll(IoSessionConfig config) { ISerialSessionConfig cfg = config as ISerialSessionConfig; if (cfg != null) { ReadTimeout = cfg.ReadTimeout; WriteBufferSize = cfg.WriteBufferSize; ReceivedBytesThreshold = cfg.ReceivedBytesThreshold; } }
public void SetAll(IoSessionConfig config) { if (config == null) { throw new ArgumentNullException(nameof(config)); } ReadBufferSize = config.ReadBufferSize; ThroughputCalculationInterval = config.ThroughputCalculationInterval; ReaderIdleTime = config.ReaderIdleTime; WriterIdleTime = config.WriterIdleTime; BothIdleTime = config.BothIdleTime; WriteTimeout = config.WriteTimeout; }
/// <inheritdoc/> public void SetAll(IoSessionConfig config) { if (config == null) { throw new ArgumentNullException("config"); } ReadBufferSize = config.ReadBufferSize; SetIdleTime(IdleStatus.BothIdle, config.GetIdleTime(IdleStatus.BothIdle)); SetIdleTime(IdleStatus.ReaderIdle, config.GetIdleTime(IdleStatus.ReaderIdle)); SetIdleTime(IdleStatus.WriterIdle, config.GetIdleTime(IdleStatus.WriterIdle)); ThroughputCalculationInterval = config.ThroughputCalculationInterval; DoSetAll(config); }
public void SetAll(IoSessionConfig config) { if (config == null) { throw new ArgumentNullException("config"); } SetIdleTime(IdleStatus.BothIdle, config.GetIdleTime(IdleStatus.BothIdle)); SetIdleTime(IdleStatus.ReaderIdle, config.GetIdleTime(IdleStatus.ReaderIdle)); SetIdleTime(IdleStatus.WriterIdle, config.GetIdleTime(IdleStatus.WriterIdle)); ThroughputCalculationInterval = config.ThroughputCalculationInterval; // other properties will be set in SerialConnector.Connect() }
protected SocketSession(IoService service, IoProcessor processor, IoSessionConfig config, System.Net.Sockets.Socket socket, EndPoint localEP, EndPoint remoteEP, Boolean reuseBuffer) : base(service) { _socket = socket; _localEP = localEP; _remoteEP = remoteEP; Config = config; if (service.SessionConfig != null) Config.SetAll(service.SessionConfig); _processor = processor; _filterChain = new DefaultIoFilterChain(this); }
/// <summary> /// </summary> protected SocketSession(IoService service, IoProcessor processor, IoSessionConfig config, System.Net.Sockets.Socket socket, EndPoint localEP, EndPoint remoteEP, Boolean reuseBuffer) : base(service) { _socket = socket; _localEP = localEP; _remoteEP = remoteEP; Config = config; if (service.SessionConfig != null) { Config.SetAll(service.SessionConfig); } _processor = processor; _filterChain = new DefaultIoFilterChain(this); }
protected override void DoSetAll(IoSessionConfig config) { ISocketSessionConfig cfg = config as ISocketSessionConfig; if (cfg == null) { return; } if (cfg.ReceiveBufferSize.HasValue) { ReceiveBufferSize = cfg.ReceiveBufferSize; } if (cfg.SendBufferSize.HasValue) { SendBufferSize = cfg.SendBufferSize; } if (cfg.ReuseAddress.HasValue) { ReuseAddress = cfg.ReuseAddress; } if (cfg.TrafficClass.HasValue) { TrafficClass = cfg.TrafficClass; } if (cfg.ExclusiveAddressUse.HasValue) { ExclusiveAddressUse = cfg.ExclusiveAddressUse; } if (cfg.KeepAlive.HasValue) { KeepAlive = cfg.KeepAlive; } if (cfg.OobInline.HasValue) { OobInline = cfg.OobInline; } if (cfg.NoDelay.HasValue) { NoDelay = cfg.NoDelay; } if (cfg.SoLinger.HasValue) { SoLinger = cfg.SoLinger; } }
protected override void DoSetAll(IoSessionConfig config) { IDatagramSessionConfig cfg = config as IDatagramSessionConfig; if (cfg == null) return; if (cfg.EnableBroadcast.HasValue) EnableBroadcast = cfg.EnableBroadcast; if (cfg.ReceiveBufferSize.HasValue) ReceiveBufferSize = cfg.ReceiveBufferSize; if (cfg.SendBufferSize.HasValue) SendBufferSize = cfg.SendBufferSize; if (cfg.ReuseAddress.HasValue) ReuseAddress = cfg.ReuseAddress; if (cfg.TrafficClass.HasValue) TrafficClass = cfg.TrafficClass; if (cfg.ExclusiveAddressUse.HasValue) ExclusiveAddressUse = cfg.ExclusiveAddressUse; MulticastOption = cfg.MulticastOption; }
/// <summary> /// </summary> protected AbstractIoService(IoSessionConfig sessionConfig) { _sessionConfig = sessionConfig; _handler = new InnerHandler(this); _stats = new IoServiceStatistics(this); }
/// <summary> /// </summary> protected AbstractIoConnector(IoSessionConfig sessionConfig) : base(sessionConfig) { }
protected AbstractIoAcceptor(IoSessionConfig sessionConfig) : base(sessionConfig) { _bindLock = ((ICollection)_boundEndPoints).SyncRoot; }
/// <inheritdoc/> public void SetAll(IoSessionConfig config) { if (config == null) throw new ArgumentNullException("config"); ReadBufferSize = config.ReadBufferSize; SetIdleTime(IdleStatus.BothIdle, config.GetIdleTime(IdleStatus.BothIdle)); SetIdleTime(IdleStatus.ReaderIdle, config.GetIdleTime(IdleStatus.ReaderIdle)); SetIdleTime(IdleStatus.WriterIdle, config.GetIdleTime(IdleStatus.WriterIdle)); ThroughputCalculationInterval = config.ThroughputCalculationInterval; DoSetAll(config); }
public FileConnector(IoSessionConfig sessionConfig) : base(sessionConfig) { idleStatusChecker = new IdleStatusChecker(() => ManagedSessions.Values); }
protected override void DoSetAll(IoSessionConfig config) { // Do nothing }
protected AbstractSocketConnector(IoSessionConfig sessionConfig) : base(sessionConfig) { _processor = new AsyncSocketProcessor(() => ManagedSessions.Values); }
public DummyService(IoSessionConfig sessionConfig) : base(sessionConfig) { }
protected abstract void DoSetAll(IoSessionConfig config);
public void SetAll(IoSessionConfig config) { if (config == null) throw new ArgumentNullException("config"); SetIdleTime(IdleStatus.BothIdle, config.GetIdleTime(IdleStatus.BothIdle)); SetIdleTime(IdleStatus.ReaderIdle, config.GetIdleTime(IdleStatus.ReaderIdle)); SetIdleTime(IdleStatus.WriterIdle, config.GetIdleTime(IdleStatus.WriterIdle)); ThroughputCalculationInterval = config.ThroughputCalculationInterval; // other properties will be set in SerialConnector.Connect() }
protected abstract void DoSetAll(IoSessionConfig config);
public SocketContext(System.Net.Sockets.Socket socket, IoSessionConfig config) { _socket = socket; receiveBuffer = new Byte[config.ReadBufferSize]; }
/// <summary> /// Instantiates. /// </summary> protected AbstractSocketConnector(IoSessionConfig sessionConfig) : base(sessionConfig) { _processor = new AsyncSocketProcessor(() => ManagedSessions.Values); }
/// <summary> /// </summary> protected AbstractIoConnector(IoSessionConfig sessionConfig) : base(sessionConfig) { }
protected override void DoSetAll(IoSessionConfig config) { // do nothing }
/// <summary> /// </summary> protected AbstractIoAcceptor(IoSessionConfig sessionConfig) : base(sessionConfig) { _bindLock = ((ICollection)_boundEndPoints).SyncRoot; }
public SocketContext(System.Net.Sockets.Socket socket, IoSessionConfig config) { _socket = socket; receiveBuffer = new Byte[config.ReadBufferSize]; }