You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
219 B
20 lines
219 B
7 years ago
|
package main
|
||
|
|
||
|
import (
|
||
7 years ago
|
"fmt"
|
||
|
"io/ioutil"
|
||
|
"net"
|
||
7 years ago
|
)
|
||
|
|
||
7 years ago
|
func main() {
|
||
7 years ago
|
conn, err := net.Dial("tcp", ":9000")
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
defer conn.Close()
|
||
7 years ago
|
|
||
7 years ago
|
bs, _ := ioutil.ReadAll(conn)
|
||
|
fmt.Println(string(bs))
|
||
7 years ago
|
|
||
|
}
|