aboutsummaryrefslogtreecommitdiffstats
path: root/SCCPHandler.st
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-12-16 21:24:22 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-12-17 21:53:17 +0100
commitb7e82ffb286af0e3e74bb59b4a754250406ec5e7 (patch)
treeae7bc2c83ca233b2dda401f3f742eda7b97be1cb /SCCPHandler.st
parentd85ae734aec4827204eac554e10b7dcae1dba21f (diff)
sccp: Prepare dealing with concurrency and locking.
Diffstat (limited to 'SCCPHandler.st')
-rw-r--r--SCCPHandler.st18
1 files changed, 13 insertions, 5 deletions
diff --git a/SCCPHandler.st b/SCCPHandler.st
index 2eaa7e5..bdbe8f1 100644
--- a/SCCPHandler.st
+++ b/SCCPHandler.st
@@ -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