Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
liujianping committed Dec 17, 2019
1 parent c78eaab commit 29beb4a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ func EchoHandler(ctx context.Context, con net.Conn) error {
}
func main() {
srv := tcpserver.NewServer(
tcpserver.Network("tcp"),
tcpserver.Address("127.0.0.1:8080"),
tcpserver.Handler(EchoHandler),
srv := tcpserver.New(
tcpserver.Address(":8080"),
tcpserver.TCPHandler(EchoHandler),
)
if err := srv.Serve(context.TODO()); err != nil {
log.Println("tcpserver failed:", err)
Expand Down

0 comments on commit 29beb4a

Please sign in to comment.