- 博客(2)
- 收藏
- 关注
原创 Golang1.7使用CGO在Go代码中定义C函数
test.h文件内容:int test(void* fn);void println(char* str);void callback(void* fn);test.c文件内容:#include <test.h>int test(void* fn){ callback(fn); println("Hello,This from Clang"); return 0;
2016-10-10 10:26:44 3682
原创 Golang1.7 Http和Tcp使用同一个端口做服务
先看一下标准库中http server的实现type tcpKeepAliveListener struct { *net.TCPListener}func (ln tcpKeepAliveListener) Accept() (c net.Conn, err error) { tc, err := ln.AcceptTCP() if err != nil {
2016-10-08 10:22:41 5920 2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人