public UDPTransmitter(Uri uri, int bufferSize) { var addresses = System.Net.Dns.GetHostAddresses(uri.Host); int port = (uri.Port < 0 ? 0 : uri.Port); if (addresses != null && addresses.Length >= 1) this.locator = new Locator(addresses[0], port); }
public static void GetLocator(this IoBuffer buffer, ref Locator obj) { obj.Kind = (LocatorKind)buffer.GetInt32(); obj.Port = (int)buffer.GetInt32(); ; byte[] tmp = new byte[16]; buffer.Get(tmp, 0, 16); obj.SocketAddressBytes = tmp; }
public static void ReadLocator(IoBuffer buffer, ref Locator obj) { if (obj == null) obj = new Locator(); obj.Kind = (LocatorKind)buffer.GetInt32(); obj.Port = (int)buffer.GetInt32(); ; byte[] tmp = new byte[16]; buffer.Get(tmp, 0, 16); obj.SocketAddressBytes = tmp; }
public static Locator GetLocator(this IoBuffer buffer) { Locator obj = new Locator(); buffer.GetLocator(ref obj); return obj; }
public static void WriteLocator(IoBuffer buffer, Locator obj) { buffer.PutInt32((int)obj.Kind); buffer.PutInt32(obj.Port); buffer.Put(obj.SocketAddressBytes); }
/// <summary> /// Constructor for UDPTransmitter. /// </summary> /// <param name="locator">Locator where the messages will be sent.</param> /// <param name="bufferSize">Size of the buffer that will be used to Write messages.</param> public UDPTransmitter(Locator locator, int bufferSize) { this.locator = locator; this.bufferSize = bufferSize; }
public UDPReceiver(Locator locator, int bufferSize) { this.bufferSize = bufferSize; this.locator = locator; }