Skip to content

Package tcpsock provides easy to use interfaces for TCP I/O, including both TcpServer and TcpClient.

License

Notifications You must be signed in to change notification settings

ecofast/tcpsock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tcpsock

Package tcpsock provides easy to use interfaces for TCP I/O.

How to use

server:

server := tcpsock.NewTcpServer(listenPort, acceptTimeout, onConnConnect, onConnClose, onProtocol)
go server.Serve()
<-shutdown
server.Close()

client:

client := tcpsock.NewTcpClient(ServerAddr, onConnect, onClose, onProtocol)
go client.Run()
<-shutdown
client.Close()

There're more detailed demos which use custom binary protocols, like:

About

Package tcpsock provides easy to use interfaces for TCP I/O, including both TcpServer and TcpClient.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages