port.go (1316:5b767c6bfd0a) port.go (1438:5e5a3897e0cd)
1/*
2 * Copyright (C) Max Romanov
3 * Copyright (C) NGINX, Inc.
4 */
5
6package unit
7
8/*

--- 124 unchanged lines hidden (view full) ---

133 return 0
134 }
135
136 n, oobn, err := p.snd.WriteMsgUnix(GoBytes(buf, buf_size),
137 GoBytes(oob, oob_size), nil)
138
139 if err != nil {
140 nxt_go_warn("write result %d (%d), %s", n, oobn, err)
1/*
2 * Copyright (C) Max Romanov
3 * Copyright (C) NGINX, Inc.
4 */
5
6package unit
7
8/*

--- 124 unchanged lines hidden (view full) ---

133 return 0
134 }
135
136 n, oobn, err := p.snd.WriteMsgUnix(GoBytes(buf, buf_size),
137 GoBytes(oob, oob_size), nil)
138
139 if err != nil {
140 nxt_go_warn("write result %d (%d), %s", n, oobn, err)
141
142 n = -1
141 }
142
143 return C.ssize_t(n)
144}
145
146//export nxt_go_port_recv
147func nxt_go_port_recv(pid C.int, id C.int, buf unsafe.Pointer, buf_size C.int,
148 oob unsafe.Pointer, oob_size C.int) C.ssize_t {

--- 10 unchanged lines hidden (view full) ---

159 return 0
160 }
161
162 n, oobn, _, _, err := p.rcv.ReadMsgUnix(GoBytes(buf, buf_size),
163 GoBytes(oob, oob_size))
164
165 if err != nil {
166 nxt_go_warn("read result %d (%d), %s", n, oobn, err)
143 }
144
145 return C.ssize_t(n)
146}
147
148//export nxt_go_port_recv
149func nxt_go_port_recv(pid C.int, id C.int, buf unsafe.Pointer, buf_size C.int,
150 oob unsafe.Pointer, oob_size C.int) C.ssize_t {

--- 10 unchanged lines hidden (view full) ---

161 return 0
162 }
163
164 n, oobn, _, _, err := p.rcv.ReadMsgUnix(GoBytes(buf, buf_size),
165 GoBytes(oob, oob_size))
166
167 if err != nil {
168 nxt_go_warn("read result %d (%d), %s", n, oobn, err)
169
170 n = -1
167 }
168
169 return C.ssize_t(n)
170}
171 }
172
173 return C.ssize_t(n)
174}