Go中的SOCK_SEQPACKET连接类型?

时间:2016-09-28 19:29:18

标签: sockets unix go lang

现在我有了这个,但在尝试连接时会感到恐慌

“恐慌:运行时错误:无效的内存地址或无指针取消引用”

/**
 * Connect to a unix domain socket
 * @param {string} name Name of socket to connect to
 * e.g. /0Whatever/0
 */
func Connect(name string)(conn net.Conn) {
  fmt.Println("Connecting to " + name)
  conn, _ = net.ListenUnixgram(name, nil)
  defer os.Remove(name)
  return conn
}

0 个答案:

没有答案