Пример #1
0
 static DomainSocket()
 {
     inputStream  = new DomainSocket.DomainInputStream(this);
     outputStream = new DomainSocket.DomainOutputStream(this);
     channel      = new DomainSocket.DomainChannel(this);
     if (SystemUtils.IsOsWindows)
     {
         loadingFailureReason = "UNIX Domain sockets are not available on Windows.";
     }
     else
     {
         if (!NativeCodeLoader.IsNativeCodeLoaded())
         {
             loadingFailureReason = "libhadoop cannot be loaded.";
         }
         else
         {
             string problem;
             try
             {
                 AnchorNative();
                 problem = null;
             }
             catch (Exception t)
             {
                 problem = "DomainSocket#anchorNative got error: " + t.Message;
             }
             loadingFailureReason = problem;
         }
     }
 }
Пример #2
0
 private DomainSocket(string path, int fd)
 {
     inputStream   = new DomainSocket.DomainInputStream(this);
     outputStream  = new DomainSocket.DomainOutputStream(this);
     channel       = new DomainSocket.DomainChannel(this);
     this.refCount = new CloseableReferenceCount();
     this.fd       = fd;
     this.path     = path;
 }