Skip to content

Does the send methods really need an error: parameter? #4

Description

@nevyn

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions