2323public class RelpConnectionFactory implements Supplier <IManagedRelpConnection > {
2424
2525 private final RelpConfig relpConfig ;
26+ private final SocketConfig socketConfig ;
2627 private final SSLContextSupplier sslContextSupplier ;
2728
2829 public RelpConnectionFactory (RelpConfig relpConfig ) {
29- this (relpConfig , new SSLContextSupplierStub ());
30+ this (relpConfig , new SocketConfigDefault ());
3031 }
32+
33+ public RelpConnectionFactory (RelpConfig relpConfig , SocketConfig socketConfig ) {
34+ this (relpConfig , socketConfig , new SSLContextSupplierStub ());
35+ }
36+
3137 public RelpConnectionFactory (RelpConfig relpConfig , SSLContextSupplier sslContextSupplier ) {
38+ this (relpConfig , new SocketConfigDefault (), sslContextSupplier );
39+ }
40+
41+ public RelpConnectionFactory (RelpConfig relpConfig , SocketConfig socketConfig , SSLContextSupplier sslContextSupplier ) {
3242 this .relpConfig = relpConfig ;
43+ this .socketConfig = socketConfig ;
3344 this .sslContextSupplier = sslContextSupplier ;
3445 }
3546
@@ -43,6 +54,11 @@ public IManagedRelpConnection get() {
4354 relpConnection = new RelpConnectionWithConfig (new RelpConnection (() -> sslContextSupplier .get ().createSSLEngine ()), relpConfig );
4455 }
4556
57+ relpConnection .setReadTimeout (socketConfig .readTimeout ());
58+ relpConnection .setWriteTimeout (socketConfig .writeTimeout ());
59+ relpConnection .setConnectionTimeout (socketConfig .connectTimeout ());
60+ relpConnection .setKeepAlive (socketConfig .keepAlive ());
61+
4662 IManagedRelpConnection managedRelpConnection = new ManagedRelpConnection (relpConnection );
4763
4864 if (relpConfig .rebindEnabled ) {
0 commit comments