Receive an IO object (a file descriptor) from the channel. The other
 side must have sent an IO object by calling send_io(). Note that
 this only works on Unix sockets.

 Might raise SystemCallError, IOError or SocketError when something
 goes wrong.
487325
def recv_io(klass = IO, negotiate = true)
      write("pass IO") if negotiate
      io = @io.recv_io(klass)
      write("got IO") if negotiate
      return io
    end
1196441
def sendTo(self, dest, chunkSize):
        
        vol = self.toVol
        paths = self.sink.getPaths(vol)

        if self.sink == dest:
            logger.info("Keep: %s", self)
            self.sink.keep(self)
        else:
            # Log, but don't skip yet, so we can log more detailed skipped actions later
            skipDryRun(logger, dest.dryrun, 'INFO')("Xfer: %s", self)

            receiveContext = dest.receive(self, paths)

            sendContext = self.sink.send(self)

            # try:
            #     receiveContext.metadata['btrfsVersion'] = self.btrfsVersion
            # except AttributeError:
            #     pass

            transfer(sendContext, receiveContext, chunkSize)

        if vol.hasInfo():
            infoContext = dest.receiveVolumeInfo(paths)

            if infoContext is None:
                # vol.writeInfo(sys.stdout)
                pass
            else:
                with infoContext as stream:
                    vol.writeInfo(stream)
548451
def p_ioport(self, p):
        ''
        p[0] = self.create_ioport(p[1], p[2], lineno=p.lineno(2))
        p.set_lineno(0, p.lineno(1))
315018
public static void receiveStream(ObjectInputStream ois, OutputStream outputStream) throws IOException {
		int b;
		while ((b = ois.read()) >= 0) {
			outputStream.write(b);
		}
		return;
	}
548014
function Receiver() {
	stream.Duplex.call(this, {
		readableObjectMode: true
	});

	this._buffer = null;
	this._frame = new Frame();
	this._state = WAITING_FOR_HEADER;
}
559848
def receive(self, diff, paths):
        
        path = self.selectReceivePath(paths)
        path = self._relativePath(path)

        if Store.skipDryRun(logger, self.dryrun)("receive to %s", path):
            return None

        (diffTo, diffFrom) = self.toArg.diff(diff)
        self._client.receive(path, diffTo, diffFrom)

        progress = DisplayProgress(diff.size) if self.showProgress is True else None
        return _SSHStream(self._client, progress)
304365
def _stream_send_and_receive(self, _socket, message, *args, **kwargs):
        """"""
        data = BytesIO()

        _socket_fd = _socket.makefile(mode='rwb', encoding='utf-8')
        _socket_fd.write(message.encode('utf-8'))
        _socket_fd.flush()

        for received in _socket_fd:
            data.write(received)
        data.seek(0)

        _socket_fd.close()
        return data
1011825
async def _receive(self, stream_id, pp_id, data):
        
        await self._data_channel_receive(stream_id, pp_id, data)
1211516
async def listener(self, channel):
        
        while True:
            message = await self.channel_layer.receive(channel)
            if not message.get("type", None):
                raise ValueError("Worker received message with no type.")
            # Make a scope and get an application instance for it
            scope = {"type": "channel", "channel": channel}
            instance_queue = self.get_or_create_application_instance(channel, scope)
            # Run the message into the app
            await instance_queue.put(message)
429659
def send(self, obj):
        
        self.zsocket.send_pyobj(obj)
        self.num_sent += 1
        if self.socket_type == zmq.REQ:
            return self.zsocket.recv_pyobj()
1370428
def socket_send(
        sock,
        msg,
        debug=False):
    
    if IS_PY2:
        sock.send(msg)
    else:
        sock.send(msg.encode())
20391
def _receive(self, root, directory, dirs, files, include, exclude):
        """"""

        self._received += 1

        if not self.symlinks:
            where = root + os.path.sep + directory + os.path.sep
            files = [
                file_name for file_name in files
                if not os.path.islink(where + file_name)
            ]

        include = FileSetState("Include", directory, include, None
                               if include else self.include)
        exclude = FileSetState("Exclude", directory, exclude, None
                               if exclude else self.exclude)

        if exclude.matches_all_files_all_subdirs():
            # Exclude everything and do no traverse any subdirectories
            del dirs[0:]
            matched = set()
        else:
            if include.no_possible_matches_in_subdirs():
                # Do no traverse any subdirectories
                del dirs[0:]
            matched = include.match(set(files))
            matched -= exclude.match(matched)

        return matched, include, exclude
951718
async def recv(self, nbytes: int = -1, **kwargs) -> bytes:
        '''
        
        '''
        return await asynclib.recv(self.sock, nbytes, **kwargs)
55576
def __send_receive_buffer(self):
        
        self.__clear_in_buffer()
        self.__send_buffer()
        read_string = self.serial.read(len(self.__in_buffer))
        if self.DEBUG_MODE:
            print("Read: '{}'".format(binascii.hexlify(read_string)))
        if len(read_string) != len(self.__in_buffer):
            raise IOError("{} bytes received for input buffer of size {}".format(len(read_string),
                                                                                 len(self.__in_buffer)))
        if not self.__is_valid_checksum(read_string):
            raise IOError("Checksum validation failed on received data")
        self.__in_buffer.value = read_string
305092
def _read_chunk_from_socket(socket):
    
    fd = socket.fileno()
    f = Future()

    def read_callback():
        get_event_loop().remove_reader(fd)

        # Read next chunk.
        try:
            data = socket.recv(1024)
        except OSError as e:
            # On OSX, when we try to create a new window by typing "pymux
            # new-window" in a centain pane, very often we get the following
            # error: "OSError: [Errno 9] Bad file descriptor."
            # This doesn't seem very harmful, and we can just try again.
            logger.warning('Got OSError while reading data from client: %s. '
                           'Trying again.', e)
            f.set_result('')
            return

        if data:
            f.set_result(data)
        else:
            f.set_exception(BrokenPipeError)

    get_event_loop().add_reader(fd, read_callback)

    return f
945630
def receive(self, decode=True):
        
        payload = self.socket.recv()
        payload = self.verify(payload)
        if decode:
            payload = self.decode(payload)
        return payload
915312
def get_io(io, offset=0)
      io = ::File.open(io, "rb") unless io.is_a?(IO) || io.is_a?(StringIO)
      io.seek(offset, ::IO::SEEK_SET)
      io
    end