New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for RFC7413 on linux for server sockets #4196
Conversation
@serioussam awesome... let me check |
@@ -136,6 +151,21 @@ void throwOutOfMemoryError(JNIEnv* env) { | |||
(*env)->ThrowNew(env, exceptionClass, ""); | |||
} | |||
|
|||
int getSysctlValue(const char * property, int* returnValue) { | |||
int rc=-1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please put spaces around =
@serioussam please address my comments and ping me once done |
@normanmaurer sure thing, I am travelling right now. I will address it once back in couple of days. |
@@ -136,6 +151,21 @@ void throwOutOfMemoryError(JNIEnv* env) { | |||
(*env)->ThrowNew(env, exceptionClass, ""); | |||
} | |||
|
|||
int getSysctlValue(const char * property, int* returnValue) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also I think this could be static
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup that makes sense we dont have any other c file needing this function, I will make it static
@normanmaurer all corrections done. Please have a look. |
return rc; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove empty line (one is enough)
@serioussam just one nit to address... after that please squash your commits and after that I will cherry-pick |
@serioussam just squash and I'm happy :) |
Motivation: TCP Fast Open allows data to be carried in the SYN and SYN-ACK packets and consumed by the receiving end during the initial connection handshake, and saves up to one full round-trip time (RTT) compared to the standard TCP, which requires a three-way handshake (3WHS) to complete before data can be exchanged. This commit enables support for TFO on server sockets. Modifications: Added new Integer Option TCP_FASTOPEN in EpollChannelOption. Added getters/setters in EpollServerChannelConfig for TCP_FASTOPEN. Added way to check if TCP_FASTOPEN is supported on server in Native. Added setting on socket opt TCP_FASTOPEN if value is set on channel options in doBind in EpollServerSocketChannel. Enhanced EpollSocketTestPermutation to contain a permutation for server socket containing fast open. Result: Users of native-epoll can set TCP_FASTOPEN on server sockets and thus leverage fast connect features of RFC7413 if client is capable of it.
@normanmaurer squashed :). |
@serioussam thanks! Cherry-picked into 4.0 (24860e7) , 4.1 (250a09d) and master (c449cea) |
Motivation:
TCP Fast Open allows data to be carried in the SYN and SYN-ACK packets and consumed by the receiving end during the initial connection handshake, and saves up to one full round-trip time (RTT) compared to the standard TCP, which requires a three-way handshake (3WHS) to complete before data can be exchanged. This commit enables support for TFO on server sockets.
Modifications:
Added new Integer Option TCP_FASTOPEN in EpollChannelOption.
Added getters/setters in EpollServerChannelConfig for TCP_FASTOPEN.
Added way to check if TCP_FASTOPEN is supported on server in Native.
Added setting on socket opt TCP_FASTOPEN if value is set on channel options in doBind in EpollServerSocketChannel.
Enhanced EpollSocketTestPermutation to contain a permutation for server socket containing fast open.
Result:
Users of native-epoll can set TCP_FASTOPEN on server sockets and thus leverage fast connect features of RFC7413 if client is capable of it.