ARTS-S golang goroutines and channels(二)

向tcp服务端发消息

package main

import (
    "io"
    "log"
    "net"
    "os"
)

func main() {
    conn, err := net.Dial("tcp", "localhost:8080")
    defer conn.Close()
    if err != nil {
        log.Fatal(err)
    }
    go mustCopy(os.Stdout, conn)
    mustCopy(conn, os.Stdin)
}

func mustCopy(dst io.Writer, src io.Reader)  {
    if _, err := io.Copy(dst, src); err != nil {
        log.Printf("mustCopy error:%v", err)
    }
}
上一篇:CNN中feature map、卷积核、卷积核个数、filter、channel的概念解释,以及CNN 学习过程中卷积核更新的理解


下一篇:tensorflow 3d cnn 代码