示例#1
0
        void InitSocketServer(Fd fd, SocketServerFlags flags)
        {
            var err = windows ? win_assuan_init_socket_server(Handle, fd, flags)
                : unix_assuan_init_socket_server(Handle, fd.UnixFd, flags);

            err.Assert();
        }
示例#2
0
 public void InitPipeServer(Fd input, Fd output)
 {
     if (windows)
     {
         var filedes = new Fd[] { input, output };
         var err     = win_assuan_init_pipe_server(Handle, filedes);
         err.Assert();
     }
     else
     {
         var filedes = new int[] { input.UnixFd, output.UnixFd };
         var err     = unix_assuan_init_pipe_server(Handle, filedes);
         err.Assert();
     }
 }
示例#3
0
 public Socket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
 {
     if (windows)
     {
         fd = win_assuan_sock_new((int)addressFamily, (int)socketType, (int)protocolType);
         if (fd == Fd.Invalid)
         {
             var err = Marshal.GetLastWin32Error();
             throw new ErrorException(ErrorSource.User1, Error.CodeFromErrno(err));
         }
     }
     else
     {
         var ret = unix_assuan_sock_new((int)addressFamily, (int)socketType, (int)protocolType);
         if (ret == -1)
         {
             var err = Marshal.GetLastWin32Error();
             throw new ErrorException(ErrorSource.User1, Error.CodeFromErrno(err));
         }
         fd = Fd.FromPosixFd(ret);
     }
 }
示例#4
0
 static extern Error win_assuan_init_socket_server(IntPtr ctx, Fd fd, SocketServerFlags flags);
示例#5
0
 static extern int win_assuan_sock_close(Fd fd);
示例#6
0
 Socket(Fd fd)
 {
     this.fd = fd;
 }
示例#7
0
 static extern Fd win_accept(Fd s, IntPtr addr, IntPtr addrlen);
示例#8
0
 static extern int win_listen(Fd s, int backlog);
示例#9
0
 static extern int win_assuan_sock_bind(Fd fd, IntPtr addr, int addrlen);