Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
github.com/firstrow/tcp_server
Package tcp_server created to help build TCP servers faster.
go get -u github.com/firstrow/tcp_server
NOTICE: OnNewMessage
callback will receive new message only if it's ending with \n
package main
import "github.com/firstrow/tcp_server"
func main() {
server := tcp_server.New("localhost:9999")
server.OnNewClient(func(c *tcp_server.Client) {
// new client connected
// lets send some message
c.Send("Hello")
})
server.OnNewMessage(func(c *tcp_server.Client, message string) {
// new message received
})
server.OnClientConnectionClosed(func(c *tcp_server.Client, err error) {
// connection with client lost
})
server.Listen()
}
To hack on this project:
go get -u github.com/firstrow/tcp_server
)git checkout -b my-new-feature
)go test
)git commit -am 'Add some feature'
)Contribute upstream:
git remote add fork git@github.com:firstrow/tcp_server.git
)git push fork my-new-feature
)Notice: Always use the original import path by installing with go get
.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.