public void broadCastCloudMessage(int mode) { UdpClient udp = new UdpClient(); string message = AvatarMessage.createRequestMessage(mode, _listenPort); byte[] data = Encoding.UTF8.GetBytes(message); IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Broadcast, _trackerPort); Debug.Log("Sent request to port" + _trackerPort + " with content " + message); udp.Send(data, data.Length, remoteEndPoint); }
public void init() { _properties = GameObject.Find("Main").GetComponent <Properties>(); GetComponent <UdpListener>().init(); _clouds = new Dictionary <string, PointCloudSimple> (); _cloudGameObjects = new Dictionary <string, GameObject>(); UdpClient udp = new UdpClient(); string message = AvatarMessage.createRequestMessage(1, int.Parse(_properties.localSetupInfo.ravatarListenPort)); // FIRST REQUEST byte[] data = Encoding.UTF8.GetBytes(message); IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Broadcast, int.Parse(_properties.remoteSetupInfo.trackerListenPort)); Debug.Log("Sent request to port " + _properties.remoteSetupInfo.trackerListenPort + " with content " + message); udp.Send(data, data.Length, remoteEndPoint); started = true; }
void Awake() { Debug.Log("Hello Tracker"); _clouds = new Dictionary <string, PointCloudSimple> (); _cloudGameObjects = new Dictionary <string, GameObject>(); _loadConfig(); UdpClient udp = new UdpClient(); string message = AvatarMessage.createRequestMessage(1, TrackerProperties.Instance.listenPort); byte[] data = Encoding.UTF8.GetBytes(message); IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Broadcast, TrackerProperties.Instance.trackerPort); Debug.Log("Sent request to port" + TrackerProperties.Instance.trackerPort + " with content " + message); udp.Send(data, data.Length, remoteEndPoint); message = SurfaceMessage.createRequestMessage(TrackerProperties.Instance.listenPort); data = Encoding.UTF8.GetBytes(message); Debug.Log("Sent request to port" + TrackerProperties.Instance.trackerPort + " with content " + message); udp.Send(data, data.Length, remoteEndPoint); }