Closed cajus closed 11 years ago
Stripped down example code is at http://ferdi.naasa.net/foobar.tar.gz .
This is because Remote.new_session_with_client is assuming that it is what is responsible for starting up the client. So the client is trying to doubly process the stream.
I would just manually do the initing of the RemoteSession and the event handlers that is done in Remote instead.
There must be something magic I don't get right now: I've replaced the RPC integration parts with
class BarBot(sleekxmpp.ClientXMPP):
def __init__(self, jid, password):
[...]
# Integrate RPC
def _session_close_callback():
pass
self.rpc_session = RemoteSession(self, _session_close_callback)
self.plugin['xep_0009'].xmpp.add_event_handler('jabber_rpc_method_call', self.rpc_session._on_jabber_rpc_method_call, threaded=True)
self.plugin['xep_0009'].xmpp.add_event_handler('jabber_rpc_method_response', self.rpc_session._on_jabber_rpc_method_response, threaded=True)
self.plugin['xep_0009'].xmpp.add_event_handler('jabber_rpc_method_fault', self.rpc_session._on_jabber_rpc_method_fault, threaded=True)
self.plugin['xep_0009'].xmpp.add_event_handler('jabber_rpc_error', self.rpc_session._on_jabber_rpc_error, threaded=True)
and added the Thermostat registration in _start
def _start(self, event):
self.send_presence()
self.get_roster()
self['xep_0115'].update_caps()
thermostat = self.rpc_session.new_handler(ANY_ALL, Thermostat, 18)
The result is that the bot never receives the RPC calls and the client says NOT IMPLEMENTED. The SSL error actually is gone.
Hmm. What is the bit I'm missing?
Looks like it can be used "the other way around". If I let the Remote() class manage the client.process() it works. Although this might be not what one wants to do it works, I'm closing the issue.
I've a bot that implements sleekxmpp.ClientXMPP and makes use XEP-0009 with the same client instance (using _Remote.new_session_withclient). Running an RPC client against the bot results in an SSL error like show below, while the stand alone RPC bot works just fine.
Parts of the bar-bot log:
Parts of the rpc_client_side.py log:
The server log (prosedy 0.8.2) says:
Any ideas what causes this?