示例#1
0
文件: callback.go 项目: zchee/gouv
func uv_tcp_simultaneous_accepts(tcp *C.uv_tcp_t, enable bool) int {
	var v C.int
	if enable {
		v = 1
	}
	return int(C.uv_tcp_simultaneous_accepts(tcp, v))
}
示例#2
0
文件: tcp.go 项目: postfix/go-uv
func (tcp *Tcp) SimultaneousAccepts(enable bool) (err error) {
	var v C.int
	if enable {
		v = 1
	}
	r := C.uv_tcp_simultaneous_accepts(tcp.t, v)
	if r != 0 {
		return tcp.GetLoop().LastError().Error()
	}
	return nil
}
示例#3
0
文件: tcp.go 项目: zchee/gouv
func (tcp *Tcp) SimultaneousAccepts(enable bool) (err error) {
	var v C.int
	if enable {
		v = 1
	}
	r := C.uv_tcp_simultaneous_accepts(tcp.t, v)
	if r != 0 {
		return &Error{int(r)}
	}
	return nil
}