Skip to content

Rft: separate udp/tcp/ws code logic #24

@wongoo

Description

@wongoo

there are lot of code that need to consider what kind of the connection, tcp or udp or ws, which let the code logic complex.

So suggest to separate udp/tcp/ws code logic.

For example, a interface can be defined:

type ProtocolHandler interface {
     handleLoop()
     handlePackage()
}

Assign matched ProtocolHandler to a protocol, not check the type of connection in handler logic, make the logic simple.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions