1
0
Fork 0

osmo: Add a way to set the token on the connection

This commit is contained in:
Holger Hans Peter Freyther 2013-03-27 08:42:50 +01:00
parent a47c76fc1b
commit dd54429310
1 changed files with 12 additions and 5 deletions

View File

@ -17,15 +17,20 @@
"
Object subclass: OsmoAppConnection [
| socket writeQueue demuxer muxer dispatcher |
| socket writeQueue demuxer muxer dispatcher token |
<category: 'OsmoNetwork-Socket'>
<comment: 'I connect to a OpenBSC App on the Control Port and wait for
TRAPS coming from the server and will act on these.'>
TRAPS coming from the server and will act on these.
TODO: re-use the IPADispatcher across connections.'>
initializeDispatcher [
"Allow another class to register handlers"
]
token: aToken [
token := aToken.
]
createConnection: aHostname port: aPort [
<category: 'socket'>
^ Sockets.Socket remote: aHostname port: aPort.
@ -52,9 +57,11 @@ TRAPS coming from the server and will act on these.'>
dispatcher initialize.
self initializeDispatcher.
ipa := IPAProtoHandler new.
ipa registerOn: dispatcher.
ipa muxer: muxer.
ipa := IPAProtoHandler new
registerOn: dispatcher;
muxer: muxer;
token: token;
yourself.
]
connect [