public static void Stop() { if(echoListener != null) echoListener.Close(); if(echoResponder != null) echoResponder.Close(); echoResponder = null; echoListener = null; }
public async static Task StartMulticastResponder(string name) { if (echoResponder != null) return; myName = name; echoResponder = new MulticastSocket(); await echoResponder.StartListening(DEFAULT_MULTICAST_GROUP, DEFAULT_MULTICAST_PORT); echoResponder.ConnectionReceived += discoveryRequestReceived; }
public async static Task DiscoverDevices() { if (echoListener==null) await runDiscoveryServer(); var discoveryEmitter = new MulticastSocket(); await discoveryEmitter.EmmitMulticast(DEFAULT_MULTICAST_GROUP, DEFAULT_MULTICAST_PORT, DEFAULT_MULTICAST_MESSAGE); }