nanorpc icon indicating copy to clipboard operation
nanorpc copied to clipboard

mutiple sever and mutliple client with nn_device

Open kuncao opened this issue 10 years ago • 1 comments

I create an issues about multi server &multi client with nn_device https://github.com/nanomsg/nanomsg/issues/832 now device infor is

int s1 = nn_socket (AF_SP_RAW, NN_REQ); nn_bind (s1, "tcp://10.120.229.120:5555"); int s2 = nn_socket (AF_SP_RAW, NN_REP); nn_bind (s2, "tcp://10.120.229.120:5556"); int sd=nn_device (s1, s2);

server int s =nn_socket(AF_SP, NN_REP), nn_connect(s,"tcp://10.120.229.120:5555")

client deployed on 10.120.93.142 int s =nn_socket(AF_SP, NN_REQ), nn_connect(s,"tcp://10.120.229.120:5556")

the client send message can cannot receive reply from server

in RpcServer.cc file, I change sockid(sock.bind(url)) to sockid(sock.connect(url)) such as following nrpc::RpcServer::RpcServer(const char* url) : sock(AF_SP, NN_REP), sockid(sock.connect(url)) { } can anyone give some suggestion? thanks a lot

kuncao avatar Nov 21 '16 12:11 kuncao

code example https://github.com/nanomsg/nanomsg/issues/832

kuncao avatar Nov 23 '16 08:11 kuncao