Online Java Compiler By
JavaTpoint.com
import java.io.IOException; import java.net.*; public class JavaSocketSetSendBufferSizeExample1 { public static void main(String[] args) throws IOException { //calling the constructor of the socket class Socket socket = new Socket(); //setSendBufferSize() sets the send buffer size or SO_SNDBUF option with the specified value socket.setSendBufferSize(67); //getSendBufferSize() method returns the buffer size(SO_SNDBUF) used by the platform for output System.out.println("Send Buffer size: "+socket.getSendBufferSize()); } }
Output