github.com/gogf/gf@v1.16.9/.example/net/gtcp/gtcp_func.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  	"os"
     6  
     7  	"github.com/gogf/gf/net/gtcp"
     8  )
     9  
    10  func main() {
    11  	dstConn, err := gtcp.NewPoolConn("www.medlinker.com:80")
    12  	_, err = dstConn.Write([]byte("HEAD / HTTP/1.1\n\n"))
    13  	if err != nil {
    14  		fmt.Fprintf(os.Stderr, "ERROR: %s\n", err.Error())
    15  	}
    16  	fmt.Println(dstConn.RecvLine())
    17  }