File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 14
14
*/
15
15
16
16
public class SplunkRawTCPInput extends SplunkInput {
17
+ private static int SOCKET_BUFFER_SIZE = 8 * 1024 ; // Default to 8192
17
18
18
19
// connection props
19
20
private String host = "" ;
@@ -24,6 +25,14 @@ public class SplunkRawTCPInput extends SplunkInput{
24
25
private OutputStream ostream ;
25
26
private Writer writerOut = null ;
26
27
28
+ public static int getSocketBufferSize () {
29
+ return SOCKET_BUFFER_SIZE ;
30
+ }
31
+
32
+ public static void setSocketBufferSize (int bufferSize ) {
33
+ SOCKET_BUFFER_SIZE = bufferSize ;
34
+ }
35
+
27
36
/**
28
37
* Create a SplunkRawTCPInput object to send events to Splunk via Raw TCP
29
38
*
@@ -50,6 +59,8 @@ private void openStream() throws Exception {
50
59
51
60
streamSocket = new Socket (host , port );
52
61
if (streamSocket .isConnected ()) {
62
+ streamSocket .setSendBufferSize (getSocketBufferSize ());
63
+ streamSocket .setReceiveBufferSize (getSocketBufferSize ());
53
64
ostream = streamSocket .getOutputStream ();
54
65
writerOut = new OutputStreamWriter (ostream , "UTF8" );
55
66
}
You can’t perform that action at this time.
0 commit comments