smalltalk
/
osmo-st-gsm
Archived
1
0
Fork 0

sccp: Make the initial dispatch based on overloading

This commit is contained in:
Holger Hans Peter Freyther 2011-06-15 16:49:26 +02:00
parent 20b808d3f0
commit 687815f60f
1 changed files with 21 additions and 12 deletions

View File

@ -210,7 +210,12 @@ Object subclass: MSGParser [
]
Osmo.SCCPMessage extend [
sccpInitialDispatch: aHandler [
^ aHandler dispatchMessage: self.
]
sccpHandlerDispatchOn: aCon [
"Message is not handled here"
self logError: 'Unhandled SCCP packet %1' % {self class} area: #sccp.
@ -218,6 +223,21 @@ Osmo.SCCPMessage extend [
]
]
Osmo.SCCPUDT extend [
sccpInitialDispatch: aHandler [
aHandler handleUDT: self.
^ true
]
]
Osmo.SCCPConnectionRequest extend [
sccpInitialDispatch: aHandler [
self logNotice: 'New incoming connection' area: #sccp.
aHandler confirmConnection: self.
^ true
]
]
Osmo.SCCPConnectionConfirm extend [
sccpHandlerDispatchOn: aCon [
aCon confirm: self.
@ -341,18 +361,7 @@ Object subclass: SCCPHandler [
^ false
].
(sccp isKindOf: Osmo.SCCPConnectionRequest) ifTrue: [
self logNotice: 'New incoming connection' area: #sccp.
self confirmConnection: sccp.
^ true
].
(sccp isKindOf: Osmo.SCCPUDT) ifTrue: [
self handleUDT: sccp.
^ true
].
self dispatchMessage: sccp.
sccp sccpInitialDispatch: self.
]
handleUDT: aSCCP [