Java ServerSocket getChannel() MethodThe getChannel() method of the ServerSocket class is used to return the unique ServerSocketChannel object associated with this socket if any. A server socket will have a channel if, and only if, the channel itself was created via the ServerSocketChannel.open method. SyntaxReturns:The server-socket channel associated with this socket, or null if this socket was not created for a channel. Since:1.4 Example 1Output: Example 2ServerApplication: Client Application Output:
Next TopicJava ServerSocket
|