News:

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

Main Menu

Socket sendUrgentData Example

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

Previous topic - Next topic

VelMurugan

Socket sendUrgentData Example

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

Socket class sendUrgentData example. public void sendUrgentData(int data) throws IOException Send one byte of urgent data on the socket. The byte to be sent is the lowest eight bits of the data parameter. The urgent byte is sent after any preceding writes to the socket OutputStream and before any future writes to the OutputStream.

Here is the code

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

import java.net.*;

public class SendUrgentData {

    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.211", 8080));

        System.out.println("send Urgent Data ... ");
        socket.sendUrgentData(12);
        socket.close();
    }
}


Output

send Urgent Data ...

Source : codingdiary