On Sep 12, 2011, at 1:12 PM, Adam Burton wrote: > Sean Kelly wrote: > >> Looks much nicer than the current std.socket. A few random comments from >> a quick scan of the code: >> >> Socket.send/receive should use ubyte[], not void[] for the data. > Regardless if it is correct or wrong I think there is a reason it is void[] > (I am sure you are aware of this but just in case you are not ;)). All > arrays implicitly convert to void[] > (http://www.digitalmars.com/d/2.0/arrays.html - Implicit conversions) and > the array length is automatically modified such that it is a byte count (for > example assigning a dstring "hello" to void[] sets void[]'s length to 20 > while dstring is 5), this lets you send data to send/receive without having > to cast it. I've inferred that to mean void[] is expected for buffers of > bytes and ubyte[]/byte[] as arrays of bytes.
Sure⦠but is this a feature that's actually desirable here? I suppose it would be good for sending char strings, but other than that I'd probably want to serialize the data somehow before sending it.
