Skip to content

Commit

Permalink
Improve socket close behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
scottf committed Jun 6, 2024
1 parent 76fac05 commit 1d5c749
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/main/java/io/nats/client/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -1295,9 +1295,11 @@ public Builder socketWriteTimeout(Duration socketWriteTimeout) {

/**
* Set the value of the socket SO LINGER property in seconds.
* This feature is built in to library data port implementations.
* A value greater than or equal to 0 will call
* socket.setSoLinger with true and the timeout value
* This feature is used by library data port implementations.
* Setting this is a last resort if socket closes are a problem
* in your environment, otherwise it's generally not necessary
* to set this. The value must be greater than or equal to 0
* to have the code call socket.setSoLinger with true and the timeout value
* @param socketSoLinger the number of seconds to linger
* @return the Builder for chaining
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/nats/client/impl/DataPort.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ default void forceClose() throws IOException {
}

void flush() throws IOException;
}
}

0 comments on commit 1d5c749

Please sign in to comment.