Skip to content
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

The socket shutdown always gives EINVAL #2

Open
sroycode opened this issue Oct 19, 2013 · 5 comments
Open

The socket shutdown always gives EINVAL #2

sroycode opened this issue Oct 19, 2013 · 5 comments

Comments

@sroycode
Copy link

Hi:
I am trying to make a proof-of-concept RPC with nanomsg and google protobuf.
The shutdown always gives EINVAL, what am I doing wrong ?

Example:
https://github.com/sroycode/nanorpc/blob/master/EchoClient.cc
line no 50 (commented out)

@sustrik
Copy link
Contributor

sustrik commented Oct 19, 2013

nn_close() should not return EINVAL, ever. Seems like a bug. I'll look into this later on.

@KjellKod
Copy link

KjellKod commented Mar 8, 2016

Any status on this and the other issue opened, or is this repository no longer maintained?

@mwpowellhtx
Copy link

Best estimate, dead on the vine. You're free to fork and run with it.

@kuncao
Copy link

kuncao commented Nov 14, 2016

Hi:
I am trying to make a proof-of-concept RPC with nanomsg and google protobuf.
The shutdown always gives EINVAL, what am I doing wrong ?

Example:
https://github.com/sroycode/nanorpc/blob/master/EchoClient.cc
line no 50 (commented out)
----I find reason
in file RpcChannel.cc
void nrpc::RpcChannel::Close()
{
if (sockid>0) {
//sock.shutdown (0);//this is commented by jack at 20161114
sock.shutdown (sockid);//this is added by jack at 20161114
sockid=0;
}
}

it is not the bug of nn_close()

@kuncao
Copy link

kuncao commented Nov 14, 2016

in file RpcServer.cc change sock.shutdown (0) to sock.shutdown (sockid) such as following:
void nrpc::RpcServer::Close()
{
if (sockid>0) {
//sock.shutdown (0);//this is commented by jack at 20161114
sock.shutdown (sockid);//this is added by jack cat 20161115
sockid=0;
}
}
the error message "Invalid argument" disappeared after control+ c
messages with sock.shutdown (0):
^CExiting on ^C 2
terminate called after throwing an instance of 'nn::exception'
what(): Invalid argument
Aborted
messages with sock.shutdown (sockid)
^CExiting on ^C 2
NN EXCEPTION : Interrupted system call

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants