Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/kisskamy/tcp-socket

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/kisskamy/tcp-socket

  • v0.0.0-20191002163753-ca47e1057440
  • Source
  • Go
  • Socket score

Version published
Created
Source

tcpSocket

A Lightweight Socket Service with heartbeat, Can be easily used in TCP server development.

Wiki Page https://github.com/kisskamy/tcpSocket

Requirements

Go version: 1.9.x or later

Usage

go get -u github.com/kisskamy/tcpSocket
import "github.com/kisskamy/tcpSocket"

func main() {
 	host := "127.0.0.1:18787"

 	ss, err := tcpSocket.NewSocketService(host)
	if err != nil {
		return
	}

	// set Heartbeat
	ss.SetHeartBeat(5*time.Second, 30*time.Second)

	// net event
	ss.RegMessageHandler(HandleMessage)
	ss.RegConnectHandler(HandleConnect)
	ss.RegDisconnectHandler(HandleDisconnect)

	ss.Serv()
}

FAQs

Package last updated on 02 Oct 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc