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:
parent
3e8d588e9b
commit
189471a586
|
@ -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 [
|
||||
|
|
Reference in New Issue