Skip to content

A suggestion to handle error message #2

@ivoryguard

Description

@ivoryguard

Hello.

I am trying to use TcpSocket.NET in my new project.

In general, the methods that start with "Try" provide a "out" parameter to get an error message.

I read TryConnectAsync and TrySendBufferAsync source code, they may hide useful network error message by dummy catch statement, which does nothing if the network operation fails.

Try-catch block is still required because TryConnectAsync/TrySendBufferAsync throws an exception in checking parameters.

It would be better that TryConnectAsync/TrySendBufferAsync handles whole exceptions and provides error message by an "out" argument, and new ConnectAsync/SendBufferAsync methods are introduced to give a chance to handle socket exceptions to developers.

Best regards.

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