News:

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

Main Menu

ServerSocket GetSoTimeout() Example

Started by VelMurugan, Jan 06, 2009, 07:16 AM

Previous topic - Next topic

VelMurugan

ServerSocket GetSoTimeout() Example

Retrieve setting for SO_TIMEOUT.

ServerSocketclass GetSoTimeout() method example. This example shows you how to use GetSoTimeout() method.This method Retrieve setting for SO_TIMEOUT.

Here is the code:-


/**
* @Program that Retrieve setting for SO_TIMEOUT.
* GetSoTimeout.java
* Author:-RoseIndia Team
* Date:-21-jun-2008
*/
import java.net.*;

public class GetSoTimeout {
public static void main(String[] args) throws Exception{
InetAddress i = InetAddress.getByName("girish-desktop");
        ServerSocket ss = new ServerSocket(8080, 1, i);
        //Returns the binding state of the ServerSocket.
        System.out.println("Setting for SO_TIMEOUT is: "+ss.getSoTimeout());
    }
}


Output of the program:-

Setting for SO_TIMEOUT is: 0

Source : codingdiary