diff --git a/osmo/OsmoStreamSocketBase.st b/osmo/OsmoStreamSocketBase.st index 4bebab8..a8fd539 100644 --- a/osmo/OsmoStreamSocketBase.st +++ b/osmo/OsmoStreamSocketBase.st @@ -48,6 +48,15 @@ supervising the RX/TX process and re-starting.'> ^port ] + targetDescription [ + + ^(WriteStream on: String new) + nextPutAll: hostname; + nextPut: $:; + nextPutAll: port asString; + contents + ] + connect [ socket ifNotNil: [socket close]. @@ -59,16 +68,18 @@ supervising the RX/TX process and re-starting.'> started := true. [ - self logNotice: 'Attempting to connect' area: #osmo. + self logNotice: ('Attempting to connect to ', + self targetDescription) area: #osmo. self connect ] on: self class connectionException do: [ - self logError: 'Failed to connect.' area: #osmo. + self logError: ('Failed to connect to ', + self targetDescription) area: #osmo. ^Osmo.TimerScheduler instance scheduleInSeconds: 1 block: [self reconnect]]. rx_proc := - [Processor activeProcess name: 'OsmoAppConnection-RX'. + [Processor activeProcess name: 'OsmoAppConnection-RX ', self targetDescription. [self driveDispatch] repeat] fork. - tx_proc := [Processor activeProcess name: 'OsmoAppConnection-TX'. + tx_proc := [Processor activeProcess name: 'OsmoAppConnection-TX ', self targetDescription. [self driveSend] repeat] fork ] @@ -93,13 +104,16 @@ supervising the RX/TX process and re-starting.'> [ self dispatchOne ] on: SystemExceptions.EndOfStream do: [:e | - self logError: 'OsmoApplication eof' area: #osmo. + self logError: ('OsmoApplication dispatch eof on ', + self targetDescription) area: #osmo. self scheduleReconnect ] on: SystemExceptions.FileError do: [:e | - self logError: 'OsmoApplication file-error' area: #osmo. + self logError: ('OsmoApplication dispatch file-error on ', + self targetDescription) area: #osmo. self scheduleReconnect ] on: Error do: [:e | - e logException: 'OsmoApplication error' area: #osmo. + e logException: ('OsmoApplication dispatch error on ', + self targetDescription) area: #osmo. self scheduleReconnect ] ] @@ -109,17 +123,19 @@ supervising the RX/TX process and re-starting.'> [ self sendOne ] on: SystemExceptions.EndOfStream do: [:e | - self logError: 'OsmoApplication eof' area: #osmo. + self logError: ('OsmoApplication send eof on ', + self targetDescription) area: #osmo. self scheduleReconnect ] on: Error do: [:e | - e logException: 'OsmoApplication error' area: #osmo. + e logException: ('OsmoApplication send error on ', + self targetDescription) area: #osmo. self scheduleReconnect ] ] reconnect [ - self logNotice: 'Going to reconnect socket' area: #osmo. + self logNotice: ('Going to reconnect socket to ', self targetDescription) area: #osmo. self terminate. started ifTrue: [self start] ]