lab001

command
v0.0.0-...-f10d331 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 9 Imported by: 0

README

简单实验1

照着conn_test文件写一个demo来运行起来

NOTICE

客户端连接生成

客户端连接生成的时候就会自动发送DH64加密的信息给服务器。

io.Copy
var wg sync.WaitGroup
	wg.Add(1)
	go func() {
		conn, err := listener.Accept()
		if err != nil {
			log.Fatalf("accept failed: %s", err.Error())
			return
		}

		io.Copy(conn, conn)
		conn.Close()
		log.Println("copy exit")
		wg.Done()
	}()

这里的io.Copy要注意一下

运行截图

Imgur

参考资料

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL