Class Socket


  • public class Socket
    extends java.lang.Object
    Native bindings to <sys/socket.h>.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int SHUT_RD
      SHUT_RDWR
      SHUT_WR
      The following constants should be used for the second parameter of shutdown.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int socket​(int __domain, int __type, int __protocol)
      Create a new socket of type __type in domain __domain, using protocol __protocol.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • socket

        public static int socket​(int __domain,
                                 int __type,
                                 int __protocol)
        Create a new socket of type __type in domain __domain, using protocol __protocol.

        If __protocol is zero, one is chosen automatically.

        Returns:
        a file descriptor for the new socket, or -1 for errors