Uses of Class
java.net.Socket
Packages that useSocket
Package
Description
Provides the classes for implementing networking applications.
Defines channels, which represent connections to entities that are capable of performing I/O operations, such as files and sockets; defines selectors, for multiplexed, non-blocking I/O operations.
Provides classes and interfaces for supporting the server side of RMI.
Provides classes for networking applications.
Provides classes for the secure socket package.
Provides implementations of
RMIClientSocketFactory andRMIServerSocketFactory over the Secure Sockets Layer (SSL) or Transport Layer Security (TLS) protocols.Platform specific socket options for the
java.net andjava.nio.channels socket classes.Uses ofSocket injava.net
Modifier and TypeMethodDescriptionServerSocket.accept()Listens for a connection to be made to this socket and accepts it.<T> SocketSocket.setOption(SocketOption<T> name, T value) Sets the value of a socket option.Modifier and TypeMethodDescriptionprotected final voidServerSocket.implAccept(Socket s) Subclasses of ServerSocket use this method to override accept() to return their own subclass of socket.Uses ofSocket injava.nio.channels
Methods injava.nio.channels that returnSocketUses ofSocket injava.rmi.server
Methods injava.rmi.server that returnSocketModifier and TypeMethodDescriptionRMIClientSocketFactory.createSocket(String host, int port) Create a client socket connected to the specified host and port.abstractSocketRMISocketFactory.createSocket(String host, int port) Creates a client socket connected to the specified host and port.Uses ofSocket injavax.net
Modifier and TypeMethodDescriptionSocketFactory.createSocket()Creates an unconnected socket.abstractSocketSocketFactory.createSocket(String host, int port) Creates a socket and connects it to the specified remote host at the specified remote port.abstractSocketSocketFactory.createSocket(String host, int port,InetAddress localHost, int localPort) Creates a socket and connects it to the specified remote host on the specified remote port.abstractSocketSocketFactory.createSocket(InetAddress host, int port) Creates a socket and connects it to the specified port number at the specified address.abstractSocketSocketFactory.createSocket(InetAddress address, int port,InetAddress localAddress, int localPort) Creates a socket and connect it to the specified remote address on the specified remote port.Uses ofSocket injavax.net.ssl
Subclasses ofSocket injavax.net.sslModifier and TypeClassDescriptionclassThis class extendsSocketand provides secure sockets using protocols such as the "Secure Sockets Layer" (SSL) or IETF "Transport Layer Security" (TLS) protocols.Methods injavax.net.ssl that returnSocketModifier and TypeMethodDescriptionSSLSocketFactory.createSocket(Socket s,InputStream consumed, boolean autoClose) Creates a server modeSocketlayered over an existing connected socket, and is able to read data which has already been consumed/removed from theSocket's underlyingInputStream.abstractSocketSSLSocketFactory.createSocket(Socket s,String host, int port, boolean autoClose) Returns a socket layered over an existing socket connected to the named host, at the given port.Methods injavax.net.ssl with parameters of typeSocketModifier and TypeMethodDescriptionabstract voidX509ExtendedTrustManager.checkClientTrusted(X509Certificate[] chain,String authType,Socket socket) Given the partial or complete certificate chain provided by the peer, build and validate the certificate path based on the authentication type and ssl parameters.abstract voidX509ExtendedTrustManager.checkServerTrusted(X509Certificate[] chain,String authType,Socket socket) Given the partial or complete certificate chain provided by the peer, build and validate the certificate path based on the authentication type and ssl parameters.X509KeyManager.chooseClientAlias(String[] keyType,Principal[] issuers,Socket socket) Choose an alias to authenticate the client side of a secure socket given the public key type and the list of certificate issuer authorities recognized by the peer (if any).X509KeyManager.chooseServerAlias(String keyType,Principal[] issuers,Socket socket) Choose an alias to authenticate the server side of a secure socket given the public key type and the list of certificate issuer authorities recognized by the peer (if any).SSLSocketFactory.createSocket(Socket s,InputStream consumed, boolean autoClose) Creates a server modeSocketlayered over an existing connected socket, and is able to read data which has already been consumed/removed from theSocket's underlyingInputStream.abstractSocketSSLSocketFactory.createSocket(Socket s,String host, int port, boolean autoClose) Returns a socket layered over an existing socket connected to the named host, at the given port.Uses ofSocket injavax.rmi.ssl
Methods injavax.rmi.ssl that returnSocketModifier and TypeMethodDescriptionSslRMIClientSocketFactory.createSocket(String host, int port) Creates an SSL socket.Uses ofSocket injdk.net
Modifier and TypeMethodDescriptionstatic <T> TSockets.getOption(Socket s,SocketOption<T> name) Deprecated.usegetOption(SocketOption)instead.static <T> voidSockets.setOption(Socket s,SocketOption<T> name, T value) Deprecated.usesetOption(SocketOption, Object)instead.