eminet icon indicating copy to clipboard operation
eminet copied to clipboard

Does the send methods really need an error: parameter?

Open nevyn opened this issue 12 years ago • 0 comments

First off, it would be very helpful to have the kinds of errors that can happen be documented, so you can code defensively for the cases that can fail. There isn't really a generic way to handle a send error that I can think of that fits here.

Secondly (and more importantly), reading the source it seems the only errors that can happen are: a) connection is closed b) the message is empty c) buffer overflow.

IMO both case a and b should be exceptions as they are programmer errors. Should (c) really be possible? I think I'd rather have an ever-growing buffer, or send: starting to block when it's getting full.

With AsyncSocket, a write can't fail.

nevyn avatar Aug 11 '13 00:08 nevyn