Added api functions for implementing protocols sending out-of-band data between server and portal (e.g. like GMCP)
This commit is contained in:
parent
3e8b43d222
commit
bced571805
6 changed files with 164 additions and 16 deletions
|
|
@ -295,6 +295,20 @@ class ServerSessionHandler(SessionHandler):
|
|||
# to put custom effects on the server due to data input, e.g.
|
||||
# from a custom client.
|
||||
|
||||
def oob_data_in(self, sessid, data):
|
||||
"""
|
||||
OOB (Out-of-band) Data Portal -> Server
|
||||
"""
|
||||
session = self.sessions.get(sessid, None)
|
||||
if session:
|
||||
session.oob_data_in(data)
|
||||
|
||||
def oob_data_out(self, session, data):
|
||||
"""
|
||||
OOB (Out-of-band) Data Server -> Portal
|
||||
"""
|
||||
self.server.amp_protocol.call_remote_OOBServer2Portal(session.sessid,
|
||||
data=data)
|
||||
|
||||
#------------------------------------------------------------
|
||||
# Portal-SessionHandler class
|
||||
|
|
@ -392,5 +406,20 @@ class PortalSessionHandler(SessionHandler):
|
|||
if session:
|
||||
session.data_out(string, data=data)
|
||||
|
||||
def oob_data_in(self, session, data):
|
||||
"""
|
||||
OOB (Out-of-band) data Portal -> Server
|
||||
"""
|
||||
self.portal.amp_protocol.call_remote_OOBPortal2Server(session.sessid,
|
||||
data=data)
|
||||
|
||||
def oob_data_out(self, sessid, data):
|
||||
"""
|
||||
OOB (Out-of-band) data Server -> Portal
|
||||
"""
|
||||
session = self.sessions.get(sessid, None)
|
||||
if session:
|
||||
session.oob_data_out(data)
|
||||
|
||||
SESSIONS = ServerSessionHandler()
|
||||
PORTAL_SESSIONS = PortalSessionHandler()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue