-
Notifications
You must be signed in to change notification settings - Fork 70
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
bind
override socket.setRawOption
#188
Comments
@yyk808 Yes, the logic of As for the "Address already in use" errors, that's just normal since reuse-port is only meaningful for server-side sockets. I don't think that's a problem for pipy. |
ad5a517 fixed state error, so the I'm convinced that "Address already in use" is indeed a bug because the #define EINVAL 22 /* Invalid argument */ pipy().task().onStart(new Message('Turn around')).connect('127.0.0.1:8000', {
onState: (conn) => {
if(conn.state === 'open') {
console.info(conn.socket.setRawOption(1, 15, new Data([1])))
}
},
bind: '127.0.0.1:1234'
}) |
TLDR
The code above won't work correctly.
Reproduce
pipy -e 'pipy().listen("127.0.0.1:8000").print().connect("127.0.0.1:1234")'
Reason
I tried to add a print in
src/socket.cpp
line 885 where we definesetRawOption
, it will only be called when not setbind
option.So it comes out that
bind
will overridesetRawOption
.The text was updated successfully, but these errors were encountered: