Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
gnet
✓ github.com/panjf2000/gnet
Start an echo server using gnet
package main
import (
"fmt"
"github.com/panjf2000/gnet"
)
type echoServer struct {
*gnet.EventServer
}
func (es *echoServer) React(frame []byte, c gnet.Conn) (out []byte, action gnet.Action) {
out = frame
return
}
func main() {
echo := &echoServer{}
fmt.Println(gnet.Serve(echo, "tcp://:8080", gnet.WithMulticore(true)))
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
1.6.7latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.