/// <summary> /// The push beacon. /// </summary> private void PushBeacon() { var loopTime = new TimeSpan(0, 0, 0, 0, 10); var loops = 0; var counter = 0; while (this.isNotDisposing) { if (10 * loops >= this.loopInterval) { loops = 0; if (this.loopInterval < this.maxLoopInterval) { this.loopInterval *= 2; } this.Conn.Send( EpicsCodec.beaconMessage(this.Conn.Port, counter++, this.Conn.IP), new IPEndPoint(this.Conn.BroadcastIPAddress, this.BeaconPort)); } else { loops++; } Thread.Sleep(loopTime); } }
/// <summary> /// Initializes a new instance of the <see cref="EpicsUDPGWConnection"/> class. /// </summary> /// <param name="gateWay"> /// The gate way. /// </param> /// <param name="Codec"> /// The codec. /// </param> public EpicsUDPGWConnection(EpicsGateWay gateWay, EpicsCodec Codec) { this.GateWay = gateWay; this.UDPSocket.SendBufferSize = this.GateWay.Config.UDPBufferSize; this.UDPSocket.ReceiveBufferSize = this.GateWay.Config.UDPBufferSize; this.wrapTargetList(this.GateWay.Config.ServerList.getStringList()); gateWay.Config.ConfigChanged += this.Config_ConfigChanged; this.codec = Codec; }
/// <summary> /// Initializes a new instance of the <see cref="EpicsTCPGWConnection"/> class. /// </summary> /// <param name="TCPSocket"> /// The tcp socket. /// </param> /// <param name="gw"> /// The gw. /// </param> internal EpicsTCPGWConnection(Socket TCPSocket, EpicsGateWay gw) : base(TCPSocket) { this.GateWay = gw; this.codec = this.GateWay.ReceiverCodec; this.clientConnection = true; this.GateWay.Statistic.ClientConnected++; this.remoteKey = TCPSocket.RemoteEndPoint.ToString(); TCPSocket.ReceiveBufferSize = this.GateWay.Config.TCPBufferSize; TCPSocket.SendBufferSize = this.GateWay.Config.TCPBufferSize; }
/// <summary> /// Initializes a new instance of the <see cref="EpicsTCPGWConnection"/> class. /// </summary> /// <param name="ipe"> /// The ipe. /// </param> /// <param name="gw"> /// The gw. /// </param> internal EpicsTCPGWConnection(IPEndPoint ipe, EpicsGateWay gw) : base(ipe) { this.GateWay = gw; this.codec = this.GateWay.ConnectorCodec; this.GateWay.Statistic.ServerConnected++; this.TCPSocket.ReceiveBufferSize = this.GateWay.Config.TCPBufferSize; this.TCPSocket.SendBufferSize = this.GateWay.Config.TCPBufferSize; this.Send(EpicsCodec.CTCPGreet); this.remoteKey = ipe.ToString(); }