Lines Matching refs:state
169 const state = socket[kStateSymbol];
171 state.handle.onmessage = onMessage;
172 state.handle.onerror = onError;
173 state.handle.recvStart();
174 state.receiving = true;
175 state.bindState = BIND_STATE_BOUND;
177 if (state.recvBufferSize)
178 bufferSize(socket, state.recvBufferSize, RECV_BUFFER);
180 if (state.sendBufferSize)
181 bufferSize(socket, state.sendBufferSize, SEND_BUFFER);
187 const state = self[kStateSymbol];
188 const oldHandle = state.handle;
189 // Sync the old handle state to new handle
201 state.handle = newHandle;
220 const state = self[kStateSymbol];
227 if (!state.handle) {
241 const state = this[kStateSymbol];
243 if (state.bindState !== BIND_STATE_UNBOUND)
246 state.bindState = BIND_STATE_BINDING;
277 const state = this[kStateSymbol];
291 state.bindState = BIND_STATE_UNBOUND;
300 const err = state.handle.open(fd);
330 state.handle.lookup(address, (err, ip) => {
332 state.bindState = BIND_STATE_UNBOUND;
340 if (state.reuseAddr)
342 if (state.ipv6Only)
355 state.bindState = BIND_STATE_UNBOUND;
359 if (!state.handle)
362 const err = state.handle.bind(ip, port || 0, flags);
365 state.bindState = BIND_STATE_UNBOUND;
389 const state = this[kStateSymbol];
391 if (state.connectState !== CONNECT_STATE_DISCONNECTED)
394 state.connectState = CONNECT_STATE_CONNECTING;
395 if (state.bindState === BIND_STATE_UNBOUND)
398 if (state.bindState !== BIND_STATE_BOUND) {
409 const state = this[kStateSymbol];
421 state.handle.lookup(address, afterDns);
426 const state = self[kStateSymbol];
427 if (!state.handle)
431 const err = state.handle.connect(ip, port);
438 state.connectState = CONNECT_STATE_DISCONNECTED;
449 state.connectState = CONNECT_STATE_CONNECTED;
455 const state = this[kStateSymbol];
456 if (state.connectState !== CONNECT_STATE_CONNECTED)
459 const err = state.handle.disconnect();
463 state.connectState = CONNECT_STATE_DISCONNECTED;
527 const state = self[kStateSymbol];
531 if (state.queue === undefined) {
532 state.queue = [];
536 ArrayPrototypePush(state.queue, toEnqueue);
553 const state = this[kStateSymbol];
554 const queue = state.queue;
555 state.queue = undefined;
585 const state = this[kStateSymbol];
586 const connected = state.connectState === CONNECT_STATE_CONNECTED;
649 if (state.bindState === BIND_STATE_UNBOUND)
657 if (state.bindState !== BIND_STATE_BOUND) {
672 state.handle.lookup(address, afterDns);
679 const state = self[kStateSymbol];
689 } else if (!state.handle) {
704 err = state.handle.send(req, list, list.length, port, ip, !!callback);
706 err = state.handle.send(req, list, list.length, !!callback);
734 const state = this[kStateSymbol];
735 const queue = state.queue;
747 state.handle.close();
748 state.handle = null;
785 const state = this[kStateSymbol];
786 if (state.connectState !== CONNECT_STATE_CONNECTED)
790 const err = state.handle.getpeername(out);
926 const state = socket[kStateSymbol];
928 if (!state.receiving)
931 state.handle.recvStop();
932 state.receiving = false;