The Trunk: Network-fbs.108.mcz

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

The Trunk: Network-fbs.108.mcz

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

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

Name: Network-fbs.108
Author: fbs
Time: 18 February 2011, 11:00:05.486 am
UUID: 228bf8a5-3dd5-be4f-a34b-2223842e5bab
Ancestors: Network-nice.107

Provide a (TCP) data send with explicit timeout. The existing method (Socket>>sendSomeData:startIndex:count:) calls the new method with a default timeout of 20s.

=============== Diff against Network-nice.107 ===============

Item was changed:
  ----- Method: Socket>>sendSomeData:startIndex:count: (in category 'sending') -----
  sendSomeData: aStringOrByteArray startIndex: startIndex count: count
+ ^ self sendSomeData: aStringOrByteArray startIndex: startIndex count: count for: 20.!
- "Send up to count bytes of the given data starting at the given index. Answer the number of bytes actually sent."
- "Note: This operation may have to be repeated multiple times to send a large amount of data."
-
- | bytesSent |
- (self waitForSendDoneFor: 20)
- ifTrue: [
- bytesSent := self primSocket: socketHandle
- sendData: aStringOrByteArray
- startIndex: startIndex
- count: count]
- ifFalse: [ConnectionTimedOut signal: 'send data timeout; data not sent'].
- ^ bytesSent
- !

Item was added:
+ ----- Method: Socket>>sendSomeData:startIndex:count:for: (in category 'sending') -----
+ sendSomeData: aStringOrByteArray startIndex: startIndex count: count for: aTimeoutInSeconds
+ "Send up to count bytes of the given data starting at the given index. Answer the number of bytes actually sent."
+ "Note: This operation may have to be repeated multiple times to send a large amount of data."
+
+ | bytesSent |
+ (self waitForSendDoneFor: aTimeoutInSeconds)
+ ifTrue: [
+ bytesSent := self primSocket: socketHandle
+ sendData: aStringOrByteArray
+ startIndex: startIndex
+ count: count]
+ ifFalse: [ConnectionTimedOut signal: 'send data timeout; data not sent'].
+ ^ bytesSent
+ !


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Network-fbs.108.mcz

Frank Shearar
On 2011/02/28 07:47, [hidden email] wrote:

> Levente Uzonyi uploaded a new version of Network to project The Trunk:
> http://source.squeak.org/trunk/Network-fbs.108.mcz
>
> ==================== Summary ====================
>
> Name: Network-fbs.108
> Author: fbs
> Time: 18 February 2011, 11:00:05.486 am
> UUID: 228bf8a5-3dd5-be4f-a34b-2223842e5bab
> Ancestors: Network-nice.107
>
> Provide a (TCP) data send with explicit timeout. The existing method (Socket>>sendSomeData:startIndex:count:) calls the new method with a default timeout of 20s.
>
> =============== Diff against Network-nice.107 ===============
<snip>

With this in trunk, we could probably fix Mantis 6850 [1] and 7199 [2].

frank

[1] http://bugs.squeak.org/view.php?id=6850
[2] http://bugs.squeak.org/view.php?id=7199