Stéphane Ducasse wrote:
On mac with VM 4.0.0 + 10293cl + fix copyandpaste httpGetDocument: url args: args accept: mimeType request: requestString I get InvalidSocketStatusException: socket ststus must Unconnected befpre.... connectNonBlockingTo:port:
After testing it for a while it seems this might be connected to a problem with closures and garbage collection. The network code works fine most of the time, but then suddenly creating a new socket returns an invalid one, thus the exception in the connect. Creating a new socket involves the following sequence: newTCP: family "Create a socket and initialise it for TCP" self initializeNetwork. ^[ super new initialize: TCPSocketType family: family ] repeatWithGCIf: [ :socket | socket isValid not ] and then on BlockContext/Closure repeatWithGCIf: testBlock | ans | "run the receiver, and if testBlock returns true, garbage collect and run the receiver again" ans := self value. (testBlock value: ans) ifTrue: [ Smalltalk garbageCollect. ans := self value ]. ^ans Ideas anyone? Michael