/// <summary> /// Notifies listeners that a device left this Radar's network. /// </summary> /// <param name="device">The device.</param> protected void RaiseDeviceLeft(SocketDevice device) { if (DevicesChanged != null) { DevicesChanged(this, RadarEvent.DEVICE_LEFT, device); } }
/// <summary> /// Notifies listeners that a device entered this Radar's network. /// </summary> /// <param name="device">The device.</param> protected void RaiseDeviceEntered(SocketDevice device) { if (DevicesChanged != null) { DevicesChanged(this, RadarEvent.DEVICE_ENTERED, device); } }
public TCPServerConnection(SocketDevice networkDevice) : base(networkDevice) { tcpListener = new TcpListener(new IPEndPoint(IPAddress.Any, networkDevice.port)); tcpListener.Server.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); tcpListener.Start(); running = true; }
private void CheckLeftDevices() { lastAddresses.RemoveWhere(a => knownAddresses.Contains(a)); foreach (var address in lastAddresses) { SocketDevice left = new SocketDevice(address, port, EthernetConnectionType.TCP); RaiseDeviceLeft(left); } lastAddresses = knownAddresses; knownAddresses = new HashSet <string>(); }
private void OnRadarEvent(object sender, RadarEvent type, SocketDevice device) { logger.Log(type.ToString() + ": " + device.networkDeviceName); switch (type) { case RadarEvent.DEVICE_ENTERED: deviceManager.DeviceEntered(device); break; case RadarEvent.DEVICE_LEFT: deviceManager.DeviceLeft(device); break; } }
private void CheckLeftDevices() { lastAddresses.RemoveWhere(a => knownAddresses.Contains(a)); foreach (var address in lastAddresses) { SocketDevice left = new SocketDevice(address, port, EthernetConnectionType.TCP); RaiseDeviceLeft(left); } lastAddresses = knownAddresses; knownAddresses = new HashSet<string>(); }
/// <summary> /// Notifies listeners that a device left this Radar's network. /// </summary> /// <param name="device">The device.</param> protected void RaiseDeviceLeft(SocketDevice device) { if (DevicesChanged != null) DevicesChanged(this, RadarEvent.DEVICE_LEFT, device); }
/// <summary> /// Notifies listeners that a device entered this Radar's network. /// </summary> /// <param name="device">The device.</param> protected void RaiseDeviceEntered(SocketDevice device) { if (DevicesChanged != null) DevicesChanged(this, RadarEvent.DEVICE_ENTERED, device); }