[squeak-dev] The Trunk: Network-ul.190.mcz
asqueaker at gmail.com
Sun Mar 26 20:52:41 UTC 2017
A better fix, thanks.
On Sun, Mar 26, 2017 at 3:34 PM, <commits at source.squeak.org> wrote:
> Levente Uzonyi uploaded a new version of Network to project The Trunk:
> ==================== Summary ====================
> Name: Network-ul.190
> Author: ul
> Time: 26 March 2017, 10:33:09.693969 pm
> UUID: 3e29be46-381f-4b14-9899-4a25585ddf57
> Ancestors: Network-cmm.189
> Don't try to disconnect from a not connected socket in Socket >> #closeAndDestroy:, because Squeak doesn't support half-closed connections.
> =============== Diff against Network-cmm.189 ===============
> Item was changed:
> ----- Method: Socket>>closeAndDestroy: (in category 'connection open/close') -----
> + closeAndDestroy: timeoutSeconds
> - closeAndDestroy: timeoutSeconds
> "First, try to close this connection gracefully. If the close attempt fails or times out, abort the connection. In either case, destroy the socket. Do nothing if the socket has already been destroyed (i.e., if its socketHandle is nil)."
> + socketHandle ifNil: [ ^self ].
> + self isConnected ifTrue: [
> + self close. "Close this end.".
> + (self waitForDisconnectionFor: timeoutSeconds) ifFalse: [
> + "The other end has not closed the connect yet, so we will just abort it."
> + self primSocketAbortConnection: socketHandle ] ].
> - socketHandle ifNil: [ ^ self ].
> - self isConnected ifTrue: [ self close ].
> - (self waitForDisconnectionFor: timeoutSeconds) ifFalse:
> - [ "The other end has not closed the connect yet, so we will just abort it."
> - [ self primSocketAbortConnection: socketHandle ]
> - on: Error
> - do: [ : err | "ignore error if invalid handle" ] ].
> self destroy!
More information about the Squeak-dev