예제 #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);