jijo-paulose / node-xmpp-bosh

Automatically exported from code.google.com/p/node-xmpp-bosh
0 stars 0 forks source link

Bug in lookup-service.js #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

It cannot be reproduced with the present implementation. So there is no bug as 
it is. The problem happens when the lookup-service is to be extended. 

What is the expected output? What do you see instead?

In lookup-service.js, the call to socket.emit('error', e) in the method 
give_up_trying_to_connect is not useful. It calls the 'error' event on the 
socket which is assigned a null value in the xmpp-proxy. 

The xmpp-proxy depeneds on the close event with a "had_error" parameter to 
communicate the error to the client. The call to this 'close' event will happen 
even without emitting the 'error' event on socket. The 'close' is pushed into 
the stack when the "connect" fails and as soon as the listeners are attached 
back to the socket, the listener of "close" is called with the "had_error" 
variable as true.

So, as of now this does not cause an issue, but if the lookup-service is to 
over-ride this behavior and fails at a different level than a socket connect 
error, there is no way to communicate this error condition back to the client. 

The lookup-service may have its own "events" which can be the contract rather 
than emitting the events of the sockets and the xmpp-proxy may rely on these 
events of the lookup-service. The idea is to allow lookup-service to 
communicate various errors back to the client.

Original issue reported on code.google.com by anup.kal...@gmail.com on 17 Aug 2011 at 7:41

GoogleCodeExporter commented 9 years ago
Yes, it would be desirable to have such an implementation if what you have in 
mind is not socket-centric. I'll be happy to accept a patch if you have one.

However, a lot of things will change since for the sake of simplicity, 
lookup-service didn't have an API of its own and clients (of lookup-service) 
just used the socket's API. Errors will need to be handled separately too.

Original comment by dhruvb...@gmail.com on 19 Aug 2011 at 4:26

GoogleCodeExporter commented 9 years ago
Issue 20 has been merged into this issue.

Original comment by dhruvb...@gmail.com on 19 Aug 2011 at 4:27

GoogleCodeExporter commented 9 years ago
Hi,
I am new to JavaScript and nodeJS. I tried to reach xmpp server(openfire) using 
Strophe on client side javascript, it works. I tried with the following 
parameters:
1) JID
2) Password
3) HostName
4) Port
5) Used proxypass

But the requirement is to use xmpp client on server side script(nodeJS). I 
tried to install node-xmpp-bosh. But i am not able to understand the 
configuration steps in node-xmpp-bosh. 

Can anyone please provide the proper configuration steps, to use the 
node-xmpp-bosh on nodeJS.

Thanks in Advance

Original comment by kiru.ven...@gmail.com on 22 Aug 2011 at 5:33

GoogleCodeExporter commented 9 years ago
Kiru Venkat, please could you open another issue rather than posting it as a 
comment here.

Original comment by dhruvb...@gmail.com on 22 Aug 2011 at 7:29

GoogleCodeExporter commented 9 years ago
Basic changes for this have been addressed by commit #413. lookup-service emits 
two events now, 'host-unknown' and 'connect'. 

Original comment by satyamsh...@gmail.com on 9 Sep 2011 at 5:57

GoogleCodeExporter commented 9 years ago
Anup, Satyam seems to have fixed this. Please could you verify if these changes 
allow you to use lookup service with non-socket connections?

Original comment by dhruvb...@gmail.com on 11 Sep 2011 at 12:25

GoogleCodeExporter commented 9 years ago
Have scheduled it to this Thursday. Will employ the changes and confirm by 15th 
Sep.

Original comment by anup.kal...@gmail.com on 11 Sep 2011 at 1:03

GoogleCodeExporter commented 9 years ago
I have verified the changes and made a few minor modifications. Instead of 
emitting "host-unreachable" I would prefer the lookup service to emit an 
"error" with a custom message which can be "host-unknown". I have made the 
changes. Once approved I will commit the same.

Original comment by anup.kal...@gmail.com on 20 Sep 2011 at 5:37