Java Socket getSendBufferSize() methodThe getSendBufferSize () method of Java Socket class returns the buffer size(SO_SNDBUF) used by the platform for output on this socket. SyntaxParameterNA ReturnThe getSendBufferSize () method returns the value of the SO_SNDBUF option of the specified Socket. ThrowsSocketException - if an error is there in the protocol, such as a TCP error. Example 1Test it NowOutput: Send Buffer size: 67 Example 2Test it NowOutput: Send Buffer size: 65536 Example 3Test it NowOutput: Exception in thread "main" java.lang.IllegalArgumentException: negative send size at java.net.Socket.setSendBufferSize(Socket.java:1193) at com.javaTpoint.JavaSocketGetSendBufferSizeExample3.main(JavaSocketGetSendBufferSizeExample3.java:11) Next TopicJava Socket Class |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India