[squeak-dev] The Inbox: Network-mtf.115.mcz

commits at source.squeak.org commits at source.squeak.org
Mon May 16 01:50:36 UTC 2011


A new version of Network was added to project The Inbox:
http://source.squeak.org/inbox/Network-mtf.115.mcz

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

Name: Network-mtf.115
Author: mtf
Time: 15 May 2011, 9:49:51.176 pm
UUID: 31a375ff-af51-cd48-836d-57292a91d1ec
Ancestors: Network-ul.114

made multicast sending when the network is disconnected not result in an infinite loop. I don't know if this is correct or not,. To reproduce:

- Unplug your network
- Do a dummy multicast send:
Socket newUDP sendData: 'XXX' toHost: #[239 99 99 99] port: 9999
- Result before patch: infinite loop
- Result after patch: NetworkError

Issue originally discovered in OpenCobalt's UPnP service

=============== Diff against Network-ul.114 ===============

Item was changed:
  ----- Method: Socket>>sendUDPData:toHost:port: (in category 'datagrams') -----
  sendUDPData: aStringOrByteArray toHost: hostAddress port: portNumber
  	"Send a UDP packet containing the given data to the specified host/port."
  	| bytesToSend bytesSent count |
  
  	bytesToSend := aStringOrByteArray size.
  	bytesSent := 0.
  	[bytesSent < bytesToSend] whileTrue: [
  		(self waitForSendDoneFor: 20)
  			ifFalse: [ConnectionTimedOut signal: 'send data timeout; data not sent'].
  		count := self primSocket: socketHandle
  			sendUDPData: aStringOrByteArray
  			toHost: hostAddress
  			port: portNumber
  			startIndex: bytesSent + 1
  			count: bytesToSend - bytesSent.
+ 		count isZero ifTrue: [NetworkError signal: 'failed to send data']..
  		bytesSent := bytesSent + count].
  
  	^ bytesSent
  !




More information about the Squeak-dev mailing list