'From etoys2.3 of 28 November 2007 [latest update: #1860] on 21 December 2007 at 11:45:46 am'! "Change Set: RestoreSocketRemovedMethods Date: 30 September 2007 Author: Masashi Umezawa For backward compatibility. (Especially to support KomServices in OLPC image)."! !Socket methodsFor: 'accessing' stamp: 'mu 9/30/2007 04:38'! remoteAddress ^ self primSocketRemoteAddress: socketHandle! ! !Socket methodsFor: 'connection open/close' stamp: 'yo 12/21/2007 11:37'! connectTo: hostAddress port: port waitForConnectionFor: timeout "Initiate a connection to the given port at the given host address. Waits until the connection is established or time outs." self connectNonBlockingTo: hostAddress port: port. self waitForConnectionFor: timeout ifTimedOut: [ConnectionTimedOut signal: 'Cannot connect to ' , self remoteSocketAddress hostNumber , ':' , port asString]! ! !Socket methodsFor: 'waiting' stamp: 'yo 12/21/2007 11:36'! waitForAcceptFor: timeout ifTimedOut: timeoutBlock "Wait and accept an incoming connection" self waitForConnectionFor: timeout ifTimedOut: [^timeoutBlock value]. ^self isConnected ifTrue:[self accept] ! !