Beispiel #1
0
 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);
 }
Beispiel #2
0
        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;
        }
Beispiel #3
0
        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;
        }
Beispiel #4
0
 public static Locator GetLocator(this IoBuffer buffer)
 {
     Locator obj = new Locator();
     buffer.GetLocator(ref obj);
     return obj;
 }
Beispiel #5
0
 public static void WriteLocator(IoBuffer buffer, Locator obj)
 {
     buffer.PutInt32((int)obj.Kind);
     buffer.PutInt32(obj.Port);
     buffer.Put(obj.SocketAddressBytes);
 }
Beispiel #6
0
 /// <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;
 }
Beispiel #7
0
 public UDPReceiver(Locator locator, int bufferSize)
 {
     this.bufferSize = bufferSize;
     this.locator = locator;
 }