Mercurial > libervia-web
comparison src/server/server.py @ 456:da2a7f2b34c9
browser and server sides: use asyncConnect instead of connect
author | souliane <souliane@mailoo.org> |
---|---|
date | Fri, 23 May 2014 10:41:42 +0200 |
parents | 1a0cec9b0f1e |
children | 07433bd892ee |
comparison
equal
deleted
inserted
replaced
455:05e98b8d9f02 | 456:da2a7f2b34c9 |
---|---|
741 def jsonrpc_isConnected(self): | 741 def jsonrpc_isConnected(self): |
742 _session = self.request.getSession() | 742 _session = self.request.getSession() |
743 profile = ISATSession(_session).profile | 743 profile = ISATSession(_session).profile |
744 return self.sat_host.bridge.isConnected(profile) | 744 return self.sat_host.bridge.isConnected(profile) |
745 | 745 |
746 def jsonrpc_connect(self): | 746 def jsonrpc_asyncConnect(self): |
747 _session = self.request.getSession() | 747 _session = self.request.getSession() |
748 profile = ISATSession(_session).profile | 748 profile = ISATSession(_session).profile |
749 if profile in self.profiles_waiting: | 749 if profile in self.profiles_waiting: |
750 raise jsonrpclib.Fault(1, 'Already waiting') # FIXME: define some standard error codes for libervia | 750 raise jsonrpclib.Fault(1, 'Already waiting') # FIXME: define some standard error codes for libervia |
751 self.profiles_waiting[profile] = self.request | 751 self.profiles_waiting[profile] = self.request |
752 self.sat_host.bridge.connect(profile) | 752 self.sat_host.bridge.asyncConnect(profile) |
753 return server.NOT_DONE_YET | 753 return server.NOT_DONE_YET |
754 | 754 |
755 def jsonrpc_isRegistered(self): | 755 def jsonrpc_isRegistered(self): |
756 """ | 756 """ |
757 @return: a couple (registered, message) with: | 757 @return: a couple (registered, message) with: |