public bool init(OnFreqUpdated v) { try { listener = new UdpClient(UDP_PORT); } catch (System.Net.Sockets.SocketException e) { if (e.SocketErrorCode == SocketError.AddressAlreadyInUse) return false; else throw; } m_notify = v; StartListener(); return true; }
public void stop() { m_notify = null; if (listener != null) listener.Close(); }