News:

GinGly.com - Used by 85,000 Members - SMS Backed up 7,35,000 - Contacts Stored  28,850 !!

Main Menu

Socket setOOBInline Example

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

Previous topic - Next topic

VelMurugan

Socket setOOBInline Example

Socket class setOOBInline example. This example shows you how to use setOOBInline method.

Socket class setOOBInline example. public void setOOBInline(boolean on) throws SocketException Enable/disable OOBINLINE (receipt of TCP urgent data) By default, this option is disabled and TCP urgent data received on a socket is silently discarded.

/*
* @ # GetOOBInline.java
* A class repersenting use to getOOBInline method
* of NumberFormat class in java.text package
* version 17 June 2008
* author Rose India
*/

import java.net.*;

public class GetOOBInline {

    public static void main(String args[]) throws Exception {

        Socket socket = new Socket();

        //Connects this socket to the server.
        socket.connect(new InetSocketAddress("192.168.10.80", 9090));

        System.out.println("Tests OOBINLINE is enabled. " + socket.getOOBInline());
        socket.setOOBInline(true);
        System.out.println("Tests OOBINLINE is enabled. " +socket.getOOBInline());

        //close socket
        socket.close();
    }
}


Output

OOBINLINE is enabled true


Source : codingdiary