Skip to content

Commit

Permalink
Update documentation to clarify timout is in milliseconds everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarian2 committed Jan 10, 2025
1 parent 3da941f commit 9c3fc01
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public int getDelay() {
/**
* Gets socket timeout in milliseconds.
*
* @return Socket timeout.
* @return Socket timeout in milliseconds.
*/
public int getTimeout() {
return (int) Math.max(getLongProperty("timeout"), 60000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ public abstract class SmtpFoundation {
private static final Logger log = LogManager.getLogger(SmtpFoundation.class);

/**
* Socket default timeout.
* Socket default timeout in milliseconds.
*/
public static final int DEFAULTTIMEOUT = 30000;

/**
* Socket extended timeout.
* Socket extended timeout in milliseconds.
* <p>Used for extendedRead().
* <p>Handy for SMTP DATA and BDAT extensions.
*/
Expand Down
31 changes: 15 additions & 16 deletions src/main/java/com/mimecast/robin/smtp/session/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ public class Session {
private int delay;

/**
* [Client] Socket timeout.
* [Client] Socket timeout in milliseconds.
*/
private int timeout = SmtpFoundation.DEFAULTTIMEOUT;

/**
* [Client] Extended socket timeout.
* [Client] Extended socket timeout in milliseconds.
*/
private int extendedtimeout = SmtpFoundation.EXTENDEDTIMEOUT;

/**
* [Client] Connect socket timeout.
* [Client] Connect socket timeout in milliseconds.
*/
private int connectTimeout = SmtpFoundation.DEFAULTTIMEOUT;

Expand Down Expand Up @@ -360,19 +360,18 @@ public Session setDelay(int delay) {
}

/**
* Gets socket timeout.
* Gets socket timeout in milliseconds.
*
* @return Socket timeout.
* @return Socket timeout in milliseconds.
*/
public int getTimeout() {
return timeout;
}

/**
* Sets socket timeout.
* <p>In seconds.
* Sets socket timeout in milliseconds.
*
* @param timeout Socket timeout.
* @param timeout Socket timeout in milliseconds.
* @return Self.
*/
public Session setTimeout(int timeout) {
Expand All @@ -381,21 +380,21 @@ public Session setTimeout(int timeout) {
}

/**
* Gets extended socket timeout.
* Gets extended socket timeout in milliseconds.
* <p>Used for extendedRead().
* <p>Handy for SMTP DATA and BDAT extensions.
*
* @return Socket timeout.
* @return Socket timeout in milliseconds.
*/
public int getExtendedTimeout() {
return extendedtimeout;
}

/**
* Sets extended socket timeout.
* Sets extended socket timeout in milliseconds.
* <p>In seconds.
*
* @param extendedtimeout Socket timeout.
* @param extendedtimeout Socket timeout in milliseconds.
* @return Self.
*/
public Session setExtendedTimeout(int extendedtimeout) {
Expand All @@ -404,20 +403,20 @@ public Session setExtendedTimeout(int extendedtimeout) {
}

/**
* Gets connect socket timeout.
* Gets connect socket timeout in milliseconds.
* <p>Used for initial connection.
*
* @return Socket timeout.
* @return Socket timeout in milliseconds.
*/
public int getConnectTimeout() {
return connectTimeout;
}

/**
* Sets cinnect socket timeout.
* Sets connect socket timeout in milliseconds.
* <p>In seconds.
*
* @param connectTimeout Socket timeout.
* @param connectTimeout Socket timeout in milliseconds.
* @return Self.
*/
public Session setConnectTimeout(int connectTimeout) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/schema/case.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"default": 0
},
"timeout": {
"description": "Socket timeout in seconds",
"description": "Socket timeout in milliseconds",
"type": "integer",
"default": 30
},
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/mapper.json5
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "/schema/case.schema.json",

"route": "net",
"timeout": 30,
"timeout": 30000,

"envelopes": [
{
Expand Down

0 comments on commit 9c3fc01

Please sign in to comment.