When i'm trying to use a java client to connect c++ server

RCFProto support and general discussion.
Post Reply
markqiu
Posts: 18
Joined: Wed Sep 12, 2012 11:13 am

When i'm trying to use a java client to connect c++ server

Post by markqiu »

************************
*** Received request ***
Client username:
Compression enabled: 0
Transport type: TCP
Transport protocol: Clear
Request:
query: "something to search for"
page_number: 0
result_per_page: 10

*** Sending response ***
Result {
url: "http://acme.org/"
title: "First result"
snippets: "A snippet from acme.org."
}
Result {
url: "http://acme.org/abc"
title: "Second result"
snippets: "Another snippet from acme.org."
}

************************
************************
*** Received request ***
Client username:
Compression enabled: 0
Transport type: TCP
Transport protocol: Clear
Request:
query: "something to search for"
page_number: 0
result_per_page: 10

*** Sending response ***
Result {
url: "http://acme.org/"
title: "First result"
snippets: "A snippet from acme.org."
}
Result {
url: "http://acme.org/abc"
title: "Second result"
snippets: "Another snippet from acme.org."
}

************************
************************
*** Received request ***
Client username:
Compression enabled: 0
Transport type: HTTP
Transport protocol: Clear
Request:
query: "something to search for"
page_number: 0
result_per_page: 10

*** Sending response ***
Result {
url: "http://acme.org/"
title: "First result"
snippets: "A snippet from acme.org."
}
Result {
url: "http://acme.org/abc"
title: "Second result"
snippets: "Another snippet from acme.org."
}

************************
************************
*** Received request ***
Client username:
Compression enabled: 0
Transport type: HTTP
Transport protocol: Clear
Request:
query: "something to search for"
page_number: 0
result_per_page: 10

*** Sending response ***
Result {
url: "http://acme.org/"
title: "First result"
snippets: "A snippet from acme.org."
}
Result {
url: "http://acme.org/abc"
title: "Second result"
snippets: "Another snippet from acme.org."
}

************************
Server certificate details: CN=localhost,O=RCF CA A,ST=Australian Capital Territory,C=AU
Server certificate issuer details: C=AU,ST=Australian Capital Territory,L=Canberra,O=RCF CA A
************************
*** Received request ***
Client username:
Compression enabled: 0
Transport type: HTTPS
Transport protocol: Clear
Request:
query: "something to search for"
page_number: 0
result_per_page: 10

*** Sending response ***
Result {
url: "http://acme.org/"
title: "First result"
snippets: "A snippet from acme.org."
}
Result {
url: "http://acme.org/abc"
title: "Second result"
snippets: "Another snippet from acme.org."
}

************************
************************
*** Received request ***
Client username:
Compression enabled: 0
Transport type: HTTPS
Transport protocol: Clear
Request:
query: "something to search for"
page_number: 0
result_per_page: 10

*** Sending response ***
Result {
url: "http://acme.org/"
title: "First result"
snippets: "A snippet from acme.org."
}
Result {
url: "http://acme.org/abc"
title: "Second result"
snippets: "Another snippet from acme.org."
}

************************
DemoClient exception:
Unable to establish network connection. OS: 2 - No such file or dir

jarl
Posts: 238
Joined: Mon Oct 03, 2011 4:53 am
Contact:

Re: When i'm trying to use a java client to connect c++ serv

Post by jarl »

It looks like the client is getting an exception while trying to connect to the UNIX local socket that the server is listening on. Are you running the client on a different machine than the server? Local sockets can only be reached from the same machine.
Kind Regards

Jarl Lindrud
Delta V Software
http://www.deltavsoft.com

markqiu
Posts: 18
Joined: Wed Sep 12, 2012 11:13 am

Re: When i'm trying to use a java client to connect c++ serv

Post by markqiu »

yes, they were on the same machine.

jarl
Posts: 238
Joined: Mon Oct 03, 2011 4:53 am
Contact:

Re: When i'm trying to use a java client to connect c++ serv

Post by jarl »

OK, I've spotted the problem... There is a name mismatch between the C++ and Java demos. The C++ server is listening on a local socket named "DemoServerSocket", while the Java client is trying to connect to a local socket named "DemoServerPipe".

I've fixed it in the codebase and the fix will be in the next release. In the meantime, you can change this line in DemoClient.java:

Code: Select all

endpoints.add(new UnixLocalEndpoint("DemoServerPipe"));
, to

Code: Select all

endpoints.add(new UnixLocalEndpoint("DemoServerSocket"));
Kind Regards

Jarl Lindrud
Delta V Software
http://www.deltavsoft.com

markqiu
Posts: 18
Joined: Wed Sep 12, 2012 11:13 am

Re: When i'm trying to use a java client to connect c++ serv

Post by markqiu »

thank you very much!

markqiu
Posts: 18
Joined: Wed Sep 12, 2012 11:13 am

Re: When i'm trying to use a java client to connect c++ serv

Post by markqiu »

don't forget to change demoserver.java at the same time.

Post Reply