An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 8.2% on proxy.golang.org

proxy.golang.org : github.com/ardanlabs/tcp

Package tcp provides the boilerpale code for working with TCP based data. The package allows you to establish a TCP listener that can accept client connections on a specified IP address and port. It also provides a function to send data back to the client. There are three interfaces that need to be implemented to use the package. These interfaces provide the API for processing data. ConnHandler The ConnHandler interface is implemented by the user to bind the client connection to a reader and writer for processing. ReqHandler The ReqHandler interface is implemented by the user to implement the processing of request messages from the client. Read is provided an ipaddress and the user-defined reader and must return the data read off the wire and the length. Returning io.EOF or a non temporary error will show down the listener. RespHandler The RespHandler interface is implemented by the user to implement the processing of the response messages to the client. Write is provided the user-defined writer and the data to write. After implementing the interfaces, the following code is all that is needed to start processing messages.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/ardanlabs/tcp
License: Apache-2.0
Latest release: over 5 years ago
First release: over 5 years ago
Namespace: github.com/ardanlabs
Stars: 15 on GitHub
Forks: 5 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 30 days ago

    Loading...
    Readme
    Loading...