public void Stop() { if (sp == null) return; sp.Stop(); sp = null; }
public void Start(string ipaddress, int port, Guid guid) { if (sp != null) throw new NotSupportedException("Service publisher already started"); sp = new ServicePublisher(UDP_SERVICE_ID, UDP_IP_GROUP); var props = new Hashtable(); props.Add("ipaddress", ipaddress); props.Add("port", port.ToString()); props.Add("guid", guid.ToString()); sp.PublishServiceEndpoint(props, UDP_IP_PORT, 3); }