-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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 custom Sockopt support #3517
Conversation
transport/internet/config.proto
Outdated
@@ -121,4 +121,6 @@ message SocketConfig { | |||
bool tcp_no_delay = 18; | |||
|
|||
bool tcp_mptcp = 19; | |||
|
|||
map<int32, int32> customSockopt = 20; |
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.
I think it is a good idea, please make it more generic that user should be able to define level (2nd param in .Setsockopt()) as well. Also it should support different value types.. Maybe something like
message Custom {
int64 level;
int64 opt;
int32 type;
string value;
}
level是可以的 type是什么() |
如果是说syscall包里的string和byte 可以这么写
反正如果输的不正确直接在后面抛错误就行了 |
改成了这样
支持了 value 和 int str选项 值全部改成了string 因为如果是int的话默认值是0 但是有时候一些值就是要设置为0 不知道到底是用户设置为0还是没填 所以改成字符串 检测空就是没填 |
Please keep value in one field, otherwise it is confusing what is being set. eg.
|
OK, it's doneee |
strconv.Atoi 的错误可能需要返回。。不过先这样吧 感谢佬! |
#3516
虽然支持一个sockopt没有意义 但是支持自定义或许有_(吗)_
举栗