[#4127] Correctly set traffic class and so linger.
Motivation: The method implementions for setSoLinger(...) and setTrafficClass(...) were swapped by mistake. Modifications: Use the correct implementation for setSoLinger(...) and setTrafficClass(...) Result: Correct behaviour when setSoLinger(...) and setTrafficClass(...) are used with the epoll transport.
This commit is contained in:
parent
695c080613
commit
94249a8d87
@ -1217,10 +1217,6 @@ JNIEXPORT void JNICALL Java_io_netty_channel_epoll_Native_setTcpNotSentLowAt(JNI
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_io_netty_channel_epoll_Native_setSoLinger(JNIEnv* env, jclass clazz, jint fd, jint optval) {
|
||||
setOption(env, fd, IPPROTO_IP, IP_TOS, &optval, sizeof(optval));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_io_netty_channel_epoll_Native_setTrafficClass(JNIEnv* env, jclass clazz, jint fd, jint optval) {
|
||||
struct linger solinger;
|
||||
if (optval < 0) {
|
||||
solinger.l_onoff = 0;
|
||||
@ -1232,6 +1228,10 @@ JNIEXPORT void JNICALL Java_io_netty_channel_epoll_Native_setTrafficClass(JNIEnv
|
||||
setOption(env, fd, SOL_SOCKET, SO_LINGER, &solinger, sizeof(solinger));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_io_netty_channel_epoll_Native_setTrafficClass(JNIEnv* env, jclass clazz, jint fd, jint optval) {
|
||||
setOption(env, fd, IPPROTO_IP, IP_TOS, &optval, sizeof(optval));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_io_netty_channel_epoll_Native_setBroadcast(JNIEnv* env, jclass clazz, jint fd, jint optval) {
|
||||
setOption(env, fd, SOL_SOCKET, SO_BROADCAST, &optval, sizeof(optval));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user