The Trunk: Network-ul.171.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Network-ul.171.mcz

commits-2
Levente Uzonyi uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-ul.171.mcz

==================== Summary ====================

Name: Network-ul.171
Author: ul
Time: 9 January 2016, 2:49:49.074506 pm
UUID: 12c693f0-700a-430c-94ff-5fe9af39c9b5
Ancestors: Network-eem.170

Made the conversion logic explicit in Socket >> #setOption:value:.

=============== Diff against Network-eem.170 ===============

Item was changed:
  ----- Method: Socket>>setOption:value: (in category 'other') -----
  setOption: aName value: aValue
  | value |
  "setup options on this socket, see Unix man pages for values for
  sockets, IP, TCP, UDP. IE SO_KEEPALIVE
  returns an array, element one is the error number
  element two is the resulting of the negotiated value.
+ See #getOption: for list of keys"
- See getOption for list of keys"
 
+ self isValid ifFalse: [
+ InvalidSocketStatusException signal: 'Socket status must valid before setting an option' ].
+ value := aValue
+ caseOf: {
+ [ true ] -> [ '1' ].
+ [ false ] -> [ '0' ] }
+ otherwise: [ aValue asString ].
- (socketHandle == nil or: [self isValid not])
- ifTrue: [InvalidSocketStatusException signal: 'Socket status must valid before setting an option'].
- value := aValue asString.
- aValue == true ifTrue: [value := '1'].
- aValue == false ifTrue: [value := '0'].
  ^ self primSocket: socketHandle setOption: aName value: value!