Lines Matching refs:sock
36 int sock;
233 netState->dbg.sock = netState->vm.sock = -1;
312 int dbgSock = netState->dbg.sock;
313 int vmSock = netState->vm.sock;
317 netState->listenSock = netState->dbg.sock = netState->vm.sock = -1;
366 int sock;
371 assert(netState->dbg.sock < 0); /* must not already be talking */
375 sock = accept(netState->listenSock, (struct sockaddr*) &addr, &addrlen);
376 if (sock < 0 && errno != EINTR) {
380 } while (sock < 0);
385 netState->dbg.sock = sock;
389 setNoDelay(sock);
401 if (netState->dbg.sock >= 0) {
403 close(netState->dbg.sock);
404 netState->dbg.sock = -1;
406 if (netState->vm.sock >= 0) {
408 close(netState->vm.sock);
409 netState->vm.sock = -1;
536 cc = write(pDst->sock, buf, length);
557 if (write(pWritePeer->sock, pReadPeer->inputBuffer,
590 assert(netState->dbg.sock >= 0);
591 sock >= 0);
598 highFd = (netState->dbg.sock > netState->vm.sock) ?
599 netState->dbg.sock+1 : netState->vm.sock+1;
601 FD_SET(netState->dbg.sock, &readfds);
602 FD_SET(netState->vm.sock, &readfds);
615 if (FD_ISSET(netState->dbg.sock, &readfds)) {
616 cc = read(netState->dbg.sock,
640 if (FD_ISSET(netState->vm.sock, &readfds)) {
641 cc = read(netState->vm.sock,
684 int sock = -1;
686 sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
687 if (sock < 0) {
695 if (connect(sock, (struct sockaddr*) &addr, sizeof(addr)) != 0) {
703 netState->vm.sock = sock;
707 setNoDelay(netState->vm.sock);
711 if (sock >= 0)
712 close(sock);