aboutsummaryrefslogtreecommitdiffstats
path: root/TestPhone.st
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-11-14 22:47:48 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-11-14 22:47:48 +0100
commitdbb9182d1df4789e3342998aa96b553d4231bff3 (patch)
tree2ef0a74ec86db1eccd44c4d02eaba757142596ed /TestPhone.st
parent8033e1822121b9fc840c1c46e6f7cb0b3e63aa50 (diff)
Use sempahore to handle things in a thread..
Diffstat (limited to 'TestPhone.st')
-rw-r--r--TestPhone.st28
1 files changed, 10 insertions, 18 deletions
diff --git a/TestPhone.st b/TestPhone.st
index f6590b4..ecb9d84 100644
--- a/TestPhone.st
+++ b/TestPhone.st
@@ -1,18 +1,5 @@
PackageLoader fileInPackage: 'OsmoNetwork'.
-Object subclass: SCCPHadler [
- <comment: 'I handle SCCP messages'>
-
- registerOn: aDispatcher [
- aDispatcher addHandler: Osmo.IPAConstants protocolSCCP
- on: self with: #handleMsg.
- ]
-
- handlerMsg: aMsg [
- 'Got a new SCCP message' printNl.
- ]
-]
-
Object subclass: IPAConnection [
| socket demuxer queue muxer dispatcher sccp ipa |
IPAConnection class >> initWith: anAddr port: aPort token: aToken [
@@ -65,7 +52,7 @@ Object subclass: IPAConnection [
]
Object subclass: IPAConfig [
- | socket addr port token connection |
+ | socket addr port token connection sem |
addr: anAddr port: aPort [
addr := anAddr.
@@ -77,17 +64,22 @@ Object subclass: IPAConfig [
]
connect [
+ sem := Semaphore new.
connection := IPAConnection initWith: addr port: port token: token.
]
connection [
^ connection
]
-]
-Object subclass: LUOperation [
-]
+ serve [
+ [
+ connection serve.
+ 'Connection disconnected' printNl.
+ sem signal.
+ ] fork.
+ ]
-Object subclass: PhoneCallOperation [
+ semaphore [ ^ sem ]
]