Frank Shearar uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-fbs.142.mcz ==================== Summary ==================== Name: Network-fbs.142 Author: fbs Time: 25 July 2013, 8:46:43.161 am UUID: 6e2a56e3-7200-e843-976b-70b6a274d722 Ancestors: Network-fbs.141 SmalltalkImage current -> Smalltalk. =============== Diff against Network-fbs.141 =============== Item was changed: ----- Method: InternetConfiguration class>>shutDown (in category 'system startup') ----- shutDown + (Smalltalk platformName = 'Mac OS') ifTrue: [ - (SmalltalkImage current platformName = 'Mac OS') ifTrue: [ HTTPSocket stopUsingProxyServer] ! Item was changed: ----- Method: InternetConfiguration class>>startUp (in category 'system startup') ----- startUp + (Smalltalk platformName = 'Mac OS') ifTrue: [ - (SmalltalkImage current platformName = 'Mac OS') ifTrue: [ self useHTTPProxy ifTrue: [ (self getHTTPProxyHost findTokens: ':') ifNotEmpty: [:p | HTTPSocket useProxyServerNamed: p first port: p second asInteger]]]! Item was changed: ----- Method: NetNameResolver class>>testIPv6 (in category 'tests') ----- testIPv6 "NetNameResolver testIPv6" | infos addr sock size host serverSocket listeningSocket clientSocket | World findATranscript: World currentEvent. Transcript clear. + "Transcript show: Smalltalk listLoadedModules; cr." - "Transcript show: SmalltalkImage current listLoadedModules; cr." self initializeNetwork. Transcript show: '---- host name ----'; cr. size := NetNameResolver primHostNameSize. host := String new: size. NetNameResolver primHostNameResult: host. Transcript show: host; cr. Transcript show: '---- address information ----'; cr. Transcript show: (infos := SocketAddressInformation forHost: 'localhost' service: 'echo' flags: 0 addressFamily: 0 socketType: 0 protocol: 0) printString; cr. Transcript show: '---- port manipulation ----'; cr. addr := infos first socketAddress. Transcript show: addr port printString; cr. addr port: 1234. Transcript show: addr port printString; cr. Transcript show: addr printString; cr. Transcript show: '---- client socket ----'; cr. Transcript show: (infos := SocketAddressInformation forHost: 'localhost' service: 'echo' flags: 0 addressFamily: 0 socketType: SocketAddressInformation socketTypeStream protocol: SocketAddressInformation protocolTCP) printString; cr. infos do: [:info | Transcript show: 'Trying ', info printString, '... '. (sock := info connect) notNil ifTrue: [sock sendData: 'hello' count: 5. Transcript show: sock receiveData printString. sock close; destroy]. Transcript cr]. Transcript show: '---- localhost defaults: loopback and wildcard addresses ----'; cr. Transcript show: (SocketAddress loopbacks) printString; cr. Transcript show: (SocketAddress wildcards) printString; cr. Transcript show: (SocketAddress loopback4) printString; cr. Transcript show: (SocketAddress wildcard4) printString; cr. Transcript show: '---- impossible constraints ----'; cr. Transcript show: (SocketAddressInformation forHost: 'localhost' service: 'echo' flags: 0 addressFamily: 0 socketType: SocketAddressInformation socketTypeDGram protocol: SocketAddressInformation protocolTCP) printString; cr. Transcript show: '---- INET4 client-server ----'; cr. Transcript show: (infos := SocketAddressInformation forHost: '' service: '4242' flags: SocketAddressInformation passiveFlag addressFamily: SocketAddressInformation addressFamilyINET4 socketType: SocketAddressInformation socketTypeStream protocol: SocketAddressInformation protocolTCP) printString; cr. listeningSocket := infos first listenWithBacklog: 5. Transcript show: (infos := SocketAddressInformation forHost: 'localhost' service: '4242' flags: 0 addressFamily: SocketAddressInformation addressFamilyINET4 socketType: SocketAddressInformation socketTypeStream protocol: SocketAddressInformation protocolTCP) printString; cr. clientSocket := infos first connect. serverSocket := listeningSocket accept. serverSocket sendData: 'Hi there!!' count: 9. Transcript show: clientSocket receiveData; cr. Transcript nextPutAll: 'client side local/remote: '; print: clientSocket localSocketAddress; space; print: clientSocket remoteSocketAddress; cr. Transcript nextPutAll: 'server side local/remote: '; print: serverSocket localSocketAddress; space; print: serverSocket remoteSocketAddress; cr; endEntry. clientSocket close; destroy. serverSocket close; destroy. listeningSocket close; destroy. Transcript show: '---- INET6 client-server ----'; cr. Transcript show: (infos := SocketAddressInformation forHost: '' service: '4242' flags: SocketAddressInformation passiveFlag addressFamily: SocketAddressInformation addressFamilyINET6 socketType: SocketAddressInformation socketTypeStream protocol: SocketAddressInformation protocolTCP) printString; cr. infos isEmpty ifTrue: [Transcript show: 'FAIL -- CANNOT CREATE INET6 SERVER'; cr] ifFalse: [listeningSocket := infos first listenWithBacklog: 5. Transcript show: (infos := SocketAddressInformation forHost: 'localhost' service: '4242' flags: 0 addressFamily: SocketAddressInformation addressFamilyINET6 socketType: SocketAddressInformation socketTypeStream protocol: SocketAddressInformation protocolTCP) printString; cr. clientSocket := infos first connect. serverSocket := listeningSocket accept. serverSocket sendData: 'Hi there!!' count: 9. Transcript show: clientSocket receiveData; cr. Transcript nextPutAll: 'client side local/remote: '; print: clientSocket localSocketAddress; space; print: clientSocket remoteSocketAddress; cr. Transcript nextPutAll: 'server side local/remote: '; print: serverSocket localSocketAddress; space; print: serverSocket remoteSocketAddress; cr; endEntry. clientSocket close; destroy. serverSocket close; destroy. listeningSocket close; destroy]. Transcript show: '---- trivial tests done ---'; cr.! Item was changed: ----- Method: PRServerDirectory>>putSmalltalkInfoInto: (in category 'private') ----- putSmalltalkInfoInto: args "private - fills args with information from Smalltalk" self flag: #todo. " lastest small-land changeset / small-land version " #(#datedVersion #osVersion #platformName #platformSubtype #vmPath #vmVersion #imageName #changesName #sourcesName #listBuiltinModules #listLoadedModules #getVMParameters ) do: [:each | | value | + value := Smalltalk perform: each. - value := SmalltalkImage current perform: each. args at: 'extra-' , each asString put: {value asString isoToSqueak}]! Item was changed: ----- Method: ServerDirectory class>>determineLocalServerDirectory: (in category 'server prefs') ----- determineLocalServerDirectory: directoryName "This is part of a workaround for Mac file name oddities regarding relative file names. The real fix should be in fullNameFor: but that seems to break other parts of the system." | dirName | dirName := directoryName. + (Smalltalk platformName = 'Mac OS' - (SmalltalkImage current platformName = 'Mac OS' and: [directoryName beginsWith: ':']) ifTrue: [ dirName := (FileDirectory default pathName endsWith: directoryName) ifTrue: [FileDirectory default pathName] ifFalse: [(FileDirectory default pathName , directoryName) replaceAll: '::' with: ':']]. ^FileDirectory default directoryNamed: dirName! |
On 25 July 2013 08:46, <[hidden email]> wrote:
> Frank Shearar uploaded a new version of Network to project The Trunk: > http://source.squeak.org/trunk/Network-fbs.142.mcz > > ==================== Summary ==================== > > Name: Network-fbs.142 > Author: fbs > Time: 25 July 2013, 8:46:43.161 am > UUID: 6e2a56e3-7200-e843-976b-70b6a274d722 > Ancestors: Network-fbs.141 > > SmalltalkImage current -> Smalltalk. > > =============== Diff against Network-fbs.141 =============== > > Item was changed: > ----- Method: InternetConfiguration class>>shutDown (in category 'system startup') ----- > shutDown > + (Smalltalk platformName = 'Mac OS') ifTrue: [ > - (SmalltalkImage current platformName = 'Mac OS') ifTrue: [ > HTTPSocket stopUsingProxyServer] > > ! > > Item was changed: > ----- Method: InternetConfiguration class>>startUp (in category 'system startup') ----- > startUp > + (Smalltalk platformName = 'Mac OS') ifTrue: [ > - (SmalltalkImage current platformName = 'Mac OS') ifTrue: [ > self useHTTPProxy ifTrue: [ > (self getHTTPProxyHost findTokens: ':') ifNotEmpty: [:p | > HTTPSocket useProxyServerNamed: p first port: p second asInteger]]]! Checking for strings is... not the best thing you could do. I'd _much_ rather see something like "Smalltalk platform isMacOS" or similar. frank |
On 25-07-2013, at 12:49 AM, Frank Shearar <[hidden email]> wrote: >> >> startUp >> + (Smalltalk platformName = 'Mac OS') ifTrue: [ >> - (SmalltalkImage current platformName = 'Mac OS') ifTrue: [ >> self useHTTPProxy ifTrue: [ >> (self getHTTPProxyHost findTokens: ':') ifNotEmpty: [:p | >> HTTPSocket useProxyServerNamed: p first port: p second asInteger]]]! > > Checking for strings is... not the best thing you could do. I'd _much_ > rather see something like "Smalltalk platform isMacOS" or similar. Definitely. But I'd suggest "Smalltalk platformIsMacOSX" so as to avoid somebody coming along and implementing a class SmalltalkPlatformDescription that is returned by #platform and responds to isMacOSX. Though a platform info class isn't a terrible idea as such, so long as it isn't spread all over the system. Like SystemNavigation - it's not a terrible thing to put allBehaviorsDo: etc into a class, so long as the main access is via something memorable - like Smalltalk allBehavioursDo: tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Strange OpCodes: SLTMDL: Shift Left, Test Mask and Dim the Lights |
In reply to this post by Frank Shearar-3
I used to think trying to "categorize" things into Smalltalk vm
thisOrThat and Smalltalk platform thisOrThat, etc. was a good idea until Andreas' argument (IIRC) opened my eyes and convinced me otherwise. IIRC, it was that it creates, for the user, an unnecessary mental exercise in language-parsing semantics every time one is required to access through them. Is #xyz part of the "vm" or part of the "platform"? Should I look it up or risk a bug? For users engrossed in the world of Smalltalk, the system-variables external to that world do not need to categorized. Just, "Smalltalk" is simpler. On Thu, Jul 25, 2013 at 2:49 AM, Frank Shearar <[hidden email]> wrote: > On 25 July 2013 08:46, <[hidden email]> wrote: >> Frank Shearar uploaded a new version of Network to project The Trunk: >> http://source.squeak.org/trunk/Network-fbs.142.mcz >> >> ==================== Summary ==================== >> >> Name: Network-fbs.142 >> Author: fbs >> Time: 25 July 2013, 8:46:43.161 am >> UUID: 6e2a56e3-7200-e843-976b-70b6a274d722 >> Ancestors: Network-fbs.141 >> >> SmalltalkImage current -> Smalltalk. >> >> =============== Diff against Network-fbs.141 =============== >> >> Item was changed: >> ----- Method: InternetConfiguration class>>shutDown (in category 'system startup') ----- >> shutDown >> + (Smalltalk platformName = 'Mac OS') ifTrue: [ >> - (SmalltalkImage current platformName = 'Mac OS') ifTrue: [ >> HTTPSocket stopUsingProxyServer] >> >> ! >> >> Item was changed: >> ----- Method: InternetConfiguration class>>startUp (in category 'system startup') ----- >> startUp >> + (Smalltalk platformName = 'Mac OS') ifTrue: [ >> - (SmalltalkImage current platformName = 'Mac OS') ifTrue: [ >> self useHTTPProxy ifTrue: [ >> (self getHTTPProxyHost findTokens: ':') ifNotEmpty: [:p | >> HTTPSocket useProxyServerNamed: p first port: p second asInteger]]]! > > Checking for strings is... not the best thing you could do. I'd _much_ > rather see something like "Smalltalk platform isMacOS" or similar. > > frank > |
Free forum by Nabble | Edit this page |