Skip to content

forgoer/socketer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Socketer

Installation

go get -u github.com/forgoer/socketer

Usage

Server:

    serv := socketer.NewServer("tcp", "127.0.0.1:6000")

    serv.OnReceive(func(data []byte, conn net.Conn) {
        fmt.Println("Server Received: ", string(data))
        serv.Send(conn, []byte("ok\n"))
    })
	
    serv.Listen()

Client:

    client := socketer.NewClient("tcp", "127.0.0.1:6000")

    client.OnReceive(func(data []byte, conn net.Conn) {
        fmt.Println("Client Received: " + string(data))
    })

    client.Dial()

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages