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

bsc: Close unknown connections, misc clean ups

This commit is contained in:
Holger Hans Peter Freyther 2011-06-19 19:05:48 +02:00
parent d547380eb9
commit 3dc78ed029
2 changed files with 14 additions and 6 deletions

View File

@ -27,7 +27,9 @@ Object subclass: BSCListener [
BSCListener class >> initWith: bscIP port: bscPort handler: aHandler [
^ self new
initSocket: bscIP port: bscPort; start; handler: aHandler;
initSocket: bscIP port: bscPort;
handler: aHandler;
start;
yourself
]
@ -51,7 +53,7 @@ Object subclass: BSCListener [
].
handler isNil
ifTrue: [con clone.]
ifTrue: [con close]
ifFalse:[handler newConnection: con].
] on: SystemExceptions.FileError do: [:each |
self logNotice: 'BSC-Socket: FileError on connection handling.' area: #bsc.
@ -61,9 +63,12 @@ Object subclass: BSCListener [
]
start [
socket := Sockets.ServerSocket
port: port bindTo: (Sockets.SocketAddress byName: ip).
[
socket := Sockets.ServerSocket
port: port bindTo: (Sockets.SocketAddress byName: ip).
] on: SystemExceptions.FileError do: [:e |
e logException: 'BSC-Socket: Failed to bind.' area: #bsc.
]
]
stop [

5
MSC.st
View File

@ -101,7 +101,10 @@ Object subclass: MSCBSCConnectionHandler [
self setupConnection: aConnection on: each.
^ true
].
]
].
self logError: 'BSC-Socket: Unknown connection from %1' % {peer} area: #bsc.
aConnection close.
]
]