News:

Choose a design and let our professionals help you build a successful website   - ITAcumens

Main Menu

Socket getSendBufferSize Example

Started by VelMurugan, Jan 10, 2009, 01:05 PM

Previous topic - Next topic

VelMurugan

Socket getSendBufferSize Example

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

Socket class getSendBufferSize example. public int getSendBufferSize() throws SocketException Get value of the SO_SNDBUF option for this Socket, that is the buffer size used by the platform for output on this Socket.

Here is the code

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

import java.net.*;

public class GetSendBufferSize {

    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 Buffer Size " + socket.getSendBufferSize());

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


Output

Send Buffer Size 8192

Source : codingdiary

nandagopal