Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected void doStart() throws SensorHubException

int count = 0;
int retryAttempts = this.config.connection.reconnectAttempts;
// boolean isRetrying = retryAttempts >= 0;

while(true) {
try {
InetAddress addr = InetAddress.getByName(config.remoteHost);
Expand All @@ -82,17 +82,15 @@ protected void doStart() throws SensorHubException
SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory.getDefault();
socket = factory.createSocket(addr, config.remotePort);
((SSLSocket) socket).startHandshake();
is = socket.getInputStream();
os = socket.getOutputStream();
} else {
SocketAddress endpoint = new InetSocketAddress(addr, config.remotePort);
socket = new Socket();
socket.connect(endpoint, this.config.connection.connectTimeout);
is = socket.getInputStream();
os = socket.getOutputStream();
// isRetrying = false;
break;
}

is = socket.getInputStream();
os = socket.getOutputStream();
break;
} catch (IOException e) {
if(++count >= retryAttempts)
throw new SensorHubException("Cannot connect to remote host "
Expand Down
Loading