News:

MyKidsDiary.in :: Capture your kids magical moment and create your Online Private Diary for your kids

Main Menu

ServerSocket GetChannel() Example

Started by VelMurugan, Jan 06, 2009, 08:04 AM

Previous topic - Next topic

VelMurugan

ServerSocket GetChannel() Example

Returns the unique ServerSocketChannel object associated with this socket, if any.

ServerSocketclass GetChannel() method example. This example shows you how to use GetChannel() method.This method Returns the unique ServerSocketChannel object associated with this socket, if any.

Here is the code:-

/**
* @Program that Returns the unique ServerSocketChannel object associated with
* this socket, if any
* GetChannel.java
* Author:-RoseIndia Team
* Date:-21-jun-2008
*/
import java.net.*;

public class GetChannel {

    public static void main(String[] args) throws Exception {
        ServerSocket ss = new ServerSocket(8080);
        //Returns the unique ServerSocketChannel object associated with this socket
        System.out.println(ss.getChannel());

    }
}


Output of the program:-

null

Source : codingdiary