Lines Matching refs:new

67 	evConn *new;
70 OKNEW(new);
71 new->flags = EV_CONN_LISTEN;
72 OKFREE(mode = fcntl(fd, F_GETFL, NULL), new); /*%< side effect: validate fd. */
83 OKFREE(ioctl(fd, FIONBIO, (char *)&on), new);
85 OKFREE(fcntl(fd, F_SETFL, mode | PORT_NONBLOCK), new);
87 new->flags |= EV_CONN_BLOCK;
89 OKFREE(listen(fd, maxconn), new);
90 if (evSelectFD(opaqueCtx, fd, EV_READ, listener, new, &new->file) < 0){
93 FREE(new);
97 new->flags |= EV_CONN_SELECTED;
98 new->func = func;
99 new->uap = uap;
100 new->fd = fd;
102 ctx->conns->prev = new;
103 new->prev = NULL;
104 new->next = ctx->conns;
105 ctx->conns = new;
107 id->opaque = new;
116 evConn *new;
118 OKNEW(new);
119 new->flags = 0;
122 connector, new, &new->file) < 0) {
125 FREE(new);
129 new->flags |= EV_CONN_SELECTED;
136 (void) evDeselectFD(opaqueCtx, new->file);
137 FREE(new);
142 new->func = func;
143 new->uap = uap;
144 new->fd = fd;
146 ctx->conns->prev = new;
147 new->prev = NULL;
148 new->next = ctx->conns;
149 ctx->conns = new;
151 id->opaque = new;
241 evAccept *new;
247 OKNEW(new);
248 new->conn = conn;
249 new->ralen = sizeof new->ra;
250 new->fd = accept(conn->fd, &new->ra.sa, &new->ralen);
251 if (new->fd > ctx->highestFD) {
252 close(new->fd);
253 new->fd = -1;
254 new->ioErrno = ENOTSOCK;
256 if (new->fd >= 0) {
257 new->lalen = sizeof new->la;
258 if (GETXXXNAME(getsockname, new->fd, new->la.sa, new->lalen) < 0) {
259 new->ioErrno = errno;
260 (void) close(new->fd);
261 new->fd = -1;
263 new->ioErrno = 0;
265 new->ioErrno = errno;
267 FREE(new);
271 INIT_LINK(new, link);
272 APPEND(ctx->accepts, new, link);
273 *sys_errno = new->ioErrno;
290 int new;
295 new = accept(fd, &ra.sa, &ralen);
296 if (new > ctx->highestFD) {
297 close(new);
298 new = -1;
301 if (new >= 0) {
303 if (GETXXXNAME(getsockname, new, la.sa, lalen) < 0) {
306 (void) close(new);
308 new = -1;
312 (*conn->func)(opaqueCtx, conn->uap, new, &la.sa, lalen, &ra.sa, ralen);