Page 1 of 1

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

Posted: Sat Aug 10, 2013 2:34 pm
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

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

Posted: Sun Aug 11, 2013 2:09 am
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.

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

Posted: Sun Aug 11, 2013 12:56 pm
by markqiu
yes, they were on the same machine.

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

Posted: Mon Aug 12, 2013 5:15 am
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"));

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

Posted: Wed Aug 14, 2013 2:31 pm
by markqiu
thank you very much!

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

Posted: Sun Aug 18, 2013 7:15 am
by markqiu
don't forget to change demoserver.java at the same time.