smalltalk
/
osmo-st-all
Archived
1
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
osmo-st-all/BSCIPAConnection.st

56 lines
1.8 KiB
Smalltalk
Raw Normal View History

"
(C) 2010 by Holger Hans Peter Freyther
All Rights Reserved
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
2010-11-07 21:15:21 +00:00
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"
PackageLoader fileInPackage: 'OsmoNetwork'.
2010-11-07 21:15:21 +00:00
Object subclass: BSCIPAConnection [
| socket config demuxer writeQueue muxer dispatcher |
<comment: 'I represent one Connection to a BSC and use the IPA
protocol to exchange messages. I will be executed from within
a thread and can do a blocking read from in here.'>
2010-11-07 21:15:21 +00:00
BSCIPAConnection class >> createOn: aSocket withConfig: aConfig [
2010-11-07 21:15:21 +00:00
^ (self new)
socket: aSocket;
instVarNamed: #config put: aConfig;
2010-11-07 21:15:21 +00:00
yourself
]
socket: aSocket [
2010-11-07 21:22:09 +00:00
socket := aSocket.
writeQueue := SharedQueue new.
demuxer := Osmo.IPADemuxer initOn: socket.
muxer := Osmo.IPAMuxer initOn: writeQueue.
dispatcher := Osmo.IPADispatcher new.
dispatcher initialize.
2010-11-07 21:15:21 +00:00
]
process [
"Drive the BSC process. This will send/queue messages"
socket logNotice: 'closing down' area: #bsc.
socket close.
]
terminateAll [
"Bring down everything that happens for this BSC. This is a reset"
self logNotice: 'BSC lac: %1 terminating.' % {config lac} area: #bsc.
]
2010-11-07 21:15:21 +00:00
]