1
0
Fork 0

osmo: Allow a subclass to change the dispatcher/ipa handler

Allow a subclass to overwrite this method to create a custom
handler. So far one could only register additional handlers but
not change the proto handler completely.
This commit is contained in:
Holger Hans Peter Freyther 2013-04-29 10:36:21 +02:00
parent 3e8d588e9b
commit 189471a586
1 changed files with 7 additions and 7 deletions

View File

@ -84,7 +84,14 @@ TODO: re-use the IPADispatcher across connections.'>
initializeDispatcher [
"Allow another class to register handlers"
dispatcher := IPADispatcher new.
dispatcher initialize.
connect_block ifNotNil: [connect_block value: dispatcher].
ipa := (IPAProtoHandler new)
registerOn: dispatcher;
muxer: muxer;
token: token;
yourself
]
nextPut: aData [
@ -129,14 +136,7 @@ TODO: re-use the IPADispatcher across connections.'>
writeQueue := SharedQueue new.
demuxer := IPADemuxer initOn: socket.
muxer := IPAMuxer initOn: writeQueue.
dispatcher := IPADispatcher new.
dispatcher initialize.
self initializeDispatcher.
ipa := (IPAProtoHandler new)
registerOn: dispatcher;
muxer: muxer;
token: token;
yourself
]
start [