示例#1
0
        public QRService(INetworkStream stream, Encoding fallbackEncoding, Logger log) : base(stream, fallbackEncoding, log)
        {
            var pi = stream.GetType().GetProperty("Socket", BindingFlags.NonPublic | BindingFlags.Instance);

            if (pi != null)
            {
                var endPoint = ((Socket)pi.GetValue(stream, null)).RemoteEndPoint as IPEndPoint;
                RemoteIP = endPoint.Address;
            }
            else
            {
                RemoteIP = new IPAddress(new byte[] { 127, 0, 0, 1 });
            }
        }
示例#2
0
 public PrintService(INetworkStream stream, Encoding fallbackEncoding, Dicom.Log.Logger log)
     : base(stream, fallbackEncoding, log)
 {
     var pi = stream.GetType()
         .GetProperty(
             "Socket",
             System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
     if (pi != null)
     {
         var endPoint =
             ((System.Net.Sockets.Socket)pi.GetValue(stream, null)).RemoteEndPoint as System.Net.IPEndPoint;
         RemoteIP = endPoint.Address;
     }
     else
     {
         RemoteIP = new System.Net.IPAddress(new byte[] { 127, 0, 0, 1 });
     }
 }
示例#3
0
        public PrintService(INetworkStream stream, Encoding fallbackEncoding, Dicom.Log.Logger log)
            : base(stream, fallbackEncoding, log)
        {
            var pi = stream.GetType()
                     .GetProperty(
                "Socket",
                System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);

            if (pi != null)
            {
                var endPoint =
                    ((System.Net.Sockets.Socket)pi.GetValue(stream, null)).RemoteEndPoint as System.Net.IPEndPoint;
                RemoteIP = endPoint.Address;
            }
            else
            {
                RemoteIP = new System.Net.IPAddress(new byte[] { 127, 0, 0, 1 });
            }
        }