The Inbox: Network-mtf.115.mcz

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

The Inbox: Network-mtf.115.mcz

commits-2
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
  !


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Network-mtf.115.mcz

Frank Shearar
On 2011/05/16 01:50, [hidden email] wrote:

> 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
>

Nice catch! I dream of having a fully mocked socket layer so we can
write proper tests for Socket.

frank