SAM: Set keepalive on sockets (ticket #1573)

Also on both sides of I2CP.
BOB already does it.
This commit is contained in:
zzz
2015-05-12 20:13:17 +00:00
parent 40130a8a61
commit b5455cee6e
5 changed files with 6 additions and 0 deletions

View File

@ -46,6 +46,7 @@ class SAMHandlerFactory {
try {
Socket sock = s.socket();
sock.setSoTimeout(HELLO_TIMEOUT);
sock.setKeepAlive(true);
String line = DataHelper.readLine(sock.getInputStream());
sock.setSoTimeout(0);
if (line == null) {

View File

@ -263,6 +263,7 @@ class SAMv3StreamSession extends SAMStreamSession implements SAMv3Handler.Sessi
// build pipes between both sockets
try {
clientServerSock.socket().setKeepAlive(true);
if (this.verbose)
SAMv3Handler.notifyStreamIncomingConnection(
clientServerSock, i2ps.getPeerDestination());