|
|
|
Jun 16th 2000.
|
Open Transport Squeak Notes (Options)
|
Bonus!
My 68K testing went really really well. An SE/30 booted up ran the test suite and we were done. So a few days were free. What to do? Well I really wanted to set and get Socket options in Squeak, so I coded up an interface. Mind this is only on the macintosh so far. If you hunt on the internet using the keywords, ie SO_LINGER you will find everything you would want to know but were afraid to ask. Below is code, which is in the image that you can use to examine the current options on the macintosh, don't forget you can set them too.
|| foo options |
Socket initializeNetwork.
foo _ Socket newTCP.
foo connectTo: (NetNameResolver addressFromString: '192.168.1.1') port: 80.
foo waitForConnectionUntil: (Socket standardDeadline).
options _ {
'SO_DEBUG'. 'SO_REUSEADDR'. 'SO_REUSEPORT'. 'SO_DONTROUTE'.
'SO_BROADCAST'. 'SO_SNDBUF'. 'SO_RCVBUF'. 'SO_KEEPALIVE'.
'SO_OOBINLINE'. 'SO_PRIORITY'. 'SO_LINGER'. 'SO_RCVLOWAT'.
'SO_SNDLOWAT'. 'IP_TTL'. 'IP_HDRINCL'. 'IP_RCVOPTS'.
'IP_RCVDSTADDR'. 'IP_MULTICAST_IF'. 'IP_MULTICAST_TTL'.
'IP_MULTICAST_LOOP'. 'UDP_CHECKSUM'. 'TCP_MAXSEG'.
'TCP_NODELAY'. 'TCP_ABORT_THRESHOLD'. 'TCP_CONN_NOTIFY_THRESHOLD'.
'TCP_CONN_ABORT_THRESHOLD'. 'TCP_NOTIFY_THRESHOLD'.
'TCP_URGENT_PTR_TYPE'}.
1 to: options size do: [:i | | fum |
fum _foo getOption: (options at: i).
Transcript show: (options at: i),fum printString;cr].
foo _ Socket newUDP.
foo setPeer: (NetNameResolver addressFromString: '192.168.1.9') port: 7.
foo waitForConnectionUntil: (Socket standardDeadline).
1 to: options size do: [:i | | fum |
fum _foo getOption: (options at: i).
Transcript show: (options at: i),fum printString;cr].
|