Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001637 [Squeak] Network minor always 08-10-05 19:32 12-10-05 21:09
Reporter KenCausey View Status public  
Assigned To gokr
Priority normal Resolution open Platform
Status acknowledged   OS
Projection none   OS Version
ETA none Fixed in Version Product Version
  Product Build
Summary 0001637: [ENH] Socket-sendUDPData
Description stefan kersten <steve@k-hornz.de>:

"from the changeset's preamble:

Adds methods to Socket for sending datagrams while avoiding unecessary
copying of data.

<sk>


'From Squeak3.5alpha of ''7 January 2003'' [latest update: #5169] on 23 January 2003 at 5:18:13 pm'!
"Change Set: Socket-sendUDPData-enh-sk
Date: 21 January 2003
Author: sk <steve@k-hornz.de>

Adds methods to Socket for sending datagrams while avoiding unecessary copying of data."!


!Socket methodsFor: 'datagrams' stamp: 'sk 1/23/2003 17:17'!
sendUDPData: aStringOrByteArray count: bytesToSend toHost: hostAddress port: portNumber
    "Send a UDP packet containing the first bytesToSend bytes of the given data to the specified host/port."

    ^ self
        sendUDPData: aStringOrByteArray
        startingAt: 1
        count: bytesToSend
        toHost: hostAddress
        port: portNumber! !

!Socket methodsFor: 'datagrams' stamp: 'sk 1/23/2003 17:16'!
sendUDPData: aStringOrByteArray startingAt: startIndex count: bytesToSend toHost: hostAddress port: portNumber
    "Send a UDP packet containing bytesToSend bytes of the given data starting at startIndex to the specified host/port."

    | bytesSent count |

    bytesSent _ 0.
    [bytesSent < bytesToSend] whileTrue: [
        (self waitForSendDoneUntil: (Socket deadlineSecs: 20))
            ifFalse: [self error: 'send data timeout; data not sent'].
        count _ self primSocket: socketHandle
            sendUDPData: aStringOrByteArray
            toHost: hostAddress
            port: portNumber
            startIndex: startIndex + bytesSent
            count: bytesToSend - bytesSent.
        bytesSent _ bytesSent + count].

    ^ bytesSent! !

!Socket methodsFor: 'datagrams' stamp: 'sk 1/23/2003 17:17'!
sendUDPData: aStringOrByteArray toHost: hostAddress port: portNumber
    "Send a UDP packet containing the given data to the specified host/port."

    ^ self
        sendUDPData: aStringOrByteArray
        startingAt: 1
        count: aStringOrByteArray size
        toHost: hostAddress
        port: portNumber! !"
Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0002225 - 175 - 237 - 276 - 276 - 276 - 276)
KenCausey
08-10-05 19:35

"Lex Spoon" <lex@cc.gatech.edu>:

"This looks like a simple and very reasonable improvement.

There is no SUnit test.

It only affects UDP, so it should be safe to add."
 
(0003270 - 72 - 72 - 72 - 72 - 72 - 72)
gokr
12-10-05 21:09

I will look it over and probably integrate in next push to inbox in 3.9.
 

- Issue History
Date Modified Username Field Change
08-10-05 19:32 KenCausey New Issue
08-10-05 19:35 KenCausey Note Added: 0002225
12-10-05 21:08 gokr Status new => assigned
12-10-05 21:08 gokr Assigned To  => gokr
12-10-05 21:09 gokr Note Added: 0003270
12-10-05 21:09 gokr Status assigned => acknowledged


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
40 total queries executed.
32 unique queries executed.
Powered by Mantis Bugtracker