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

sccp: Prepare dealing with concurrency and locking.

This commit is contained in:
Holger Hans Peter Freyther 2010-12-16 21:24:22 +01:00
parent d85ae734ae
commit b7e82ffb28
1 changed files with 13 additions and 5 deletions

View File

@ -208,6 +208,14 @@ Object subclass: SCCPHandler [
| connections last_ref connection |
<comment: 'I handle SCCP messages'>
addConnection: aConnection [
self connections add: aConnection
]
removeConnection: aConnection [
self connections remove: aConnection.
]
registerOn: aDispatcher [
aDispatcher addHandler: Osmo.IPAConstants protocolSCCP
on: self with: #handleMsg:.
@ -215,7 +223,7 @@ Object subclass: SCCPHandler [
connectionTimeout: aConnection [
('SCCP Connection ', aConnection srcRef asString, ' timeout.') printNl.
self connections remove: aConnection.
self removeConnection: aConnection.
]
forwardMessage: aMessage with: aConnection[
@ -232,13 +240,13 @@ Object subclass: SCCPHandler [
(aMessage isKindOf: Osmo.SCCPConnectionReleased)
ifTrue: [
aConnection released: aMessage.
self connections remove: aConnection.
self removeConnection: aConnection.
^ true
].
(aMessage isKindOf: Osmo.SCCPConnectionReleaseComplete)
ifTrue: [
aConnection releaseComplete: aMessage.
self connections remove: aConnection.
self removeConnection: aConnection.
^ true.
].
@ -272,7 +280,7 @@ Object subclass: SCCPHandler [
con := SCCPConnection new.
con srcRef: self assignSrcRef.
con conManager: self.
self connections add: con.
self addConnection: con.
"Confirm the messga now and send any data"
con confirm: aMsg.
@ -326,7 +334,7 @@ Object subclass: SCCPHandler [
con conManager: self.
res := Osmo.SCCPConnectionRequest
initWith: (con srcRef) dest: (Osmo.SCCPAddress createWith: 254) data: aData.
self connections add: con.
self addConnection: con.
self sendMsg: res toMessage.
^ con