예제 #1
0
 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;
 }
예제 #2
0
 public void stop()
 {
     m_notify = null;
     if (listener != null)
         listener.Close();
 }