Internal: write the given item to the socket

 msg - the message to write

 Returns nothing
198881
def write( msg )
      $stderr.puts "--> #{msg}" if $DEBUG
      socket.write( msg )
    rescue KJess::NetworkError
      close
      raise
    rescue => e
      close
      raise Error, "Could not write to #{host}:#{port}: #{e.class}: #{e.message}", e.backtrace
    end
1232254
@Override
    protected void write(List<Message> msgList) throws IOException {
        for (Message msg : msgList) {
            writer.writeTo(msg);

            String routingKey = normalizeRoutingKey(msg);

            DynamicCounter.increment(
                    MonitorConfig.builder("writtenMessages")
                            .withTag(TagKey.DATA_SOURCE, routingKey)
                            .build());
            ++writtenMessages;
            DynamicCounter.increment(
                    MonitorConfig.builder("writtenBytes")
                            .withTag(TagKey.DATA_SOURCE, routingKey)
                            .build(), msg.getPayload().length);
            writtenBytes += msg.getPayload().length;

            messageWrittenInRotation = true;
        }

        writer.sync();

        throughput.increment(msgList.size());
    }
930303
def write(data, timeout = @timeout)
      full_size = data.bytesize

      while data.bytesize > 0
        written = socket.write_nonblock(data, exception: false)

        if written == :wait_writable
          socket.wait_writable(timeout) or fail_with_timeout!
        else
          data = data.byteslice(written..-1)
        end
      end

      full_size
    end
583447
def send(self, msg, timeout=None, tries=None):
        '''
        
        '''
        if not self.connected():
            yield self.connect()
        pack = salt.transport.frame.frame_msg_ipc(msg, raw_body=True)
        yield self.stream.write(pack)
648989
def write_main_socket(c):
    """"""
    the_stdin_thread.socket_write.send(c)
    while True:
        try:
            the_stdin_thread.socket_write.recv(1)
        except socket.error as e:
            if e.errno != errno.EINTR:
                raise
        else:
            break
1374974
def writeln (self, msg):
        """"""
        self.fd.write(u"%s%s" % (msg, unicode(os.linesep)))
460958
def write( buf )
      until buf.nil? or (buf.length == 0) do
        written = socket.write_nonblock(buf)
        buf = buf[written, buf.length]
      end
    rescue Errno::EWOULDBLOCK, Errno::EINTR, Errno::EAGAIN, Errno::ECONNRESET
      if wait_writable(write_timeout)
        retry
      else
        raise Timeout, "Could not write to #{host}:#{port} in #{write_timeout} seconds"
      end
    end
1345127
def write(self, buf):
        """"""
        return self.transport_sock.sendto(
            buf,
            (self.transport_host, self.transport_port)
        )
424037
def write(self, path, data, offset=0, timeout=0):
        

        # fixme: check of path type delayed to str2bytez
        if not isinstance(data, (bytes, bytearray, )):
            raise TypeError("'data' argument must be binary")

        ret, rdata = self.sendmess(MSG_WRITE, str2bytez(path) + data,
                                   size=len(data), offset=offset,
                                   timeout=timeout)
        assert not rdata, (ret, rdata)
        if ret < 0:
            raise OwnetError(-ret, self.errmess[-ret], path)
595242
def write(self, data, debug_info=None):
        
        self.num_write_bytes += len(data)
        if self.debug:
            if not debug_info:
                debug_info = str(len(data))
            sys.stderr.write("%s: WRITE %s:\n%s\n" % (
                self.__class__.__name__,
                debug_info,
                pyhsm.util.hexdump(data)
            ))
        write_sock(self.socket_file, CMD_WRITE, data)
        return read_sock(self.socket_file)
497148
def write(bytes)
      loop do
        written = 0
        begin
          # unlike plain tcp sockets, ssl sockets don't support IO.select
          # properly.
          # Instead, timeouts happen on a per write basis, and we have to
          # catch exceptions from write_nonblock, and gradually build up
          # our write buffer.
          written += @ssl_socket.write_nonblock(bytes)
        rescue Errno::EFAULT => error
          raise error
        rescue OpenSSL::SSL::SSLError, Errno::EAGAIN, Errno::EWOULDBLOCK, IO::WaitWritable => error
          if error.is_a?(OpenSSL::SSL::SSLError) && error.message == 'write would block'
            if select_with_timeout(@ssl_socket, :write)
              retry
            else
              raise Errno::ETIMEDOUT
            end
          else
            raise error
          end
        end

        # Fast, common case.
        break if written == bytes.size

        # This takes advantage of the fact that most ruby implementations
        # have Copy-On-Write strings. Thusly why requesting a subrange
        # of data, we actually don't copy data because the new string
        # simply references a subrange of the original.
        bytes = bytes[written, bytes.size]
      end
    end
54277
function write (item) {

  var filename = item.file;
  var message = item.message;
  var header = item.header;
  var file = path.join(p_, filename);

  fs.exists(file, function (exists) {
    if (exists) {
      fs.appendFile(file, message, function () {
        task();
      });

    } else {
      if (header) {
        message = header + EOL + message;
      }

      var dir = path.dirname(file);
      fs.exists(dir, function (exists) {
        if (exists) {
          fs.appendFile(file, message, function () {
            task();
          });

        } else {
          fs.mkdirs(dir, function (err) {
            if (err) {
              console.error(err);
              task();
            } else {
              fs.appendFile(file, message, function () {
                task();
              });
            }
          });
        }
      });
    }
  });
}
1228700
function write(message, handle) {
		var result = false
		var err
		var args = Array.prototype.slice.call(arguments)
		var cb = typeof args[args.length - 1] === 'function' ? args.pop() : null
		if (args.length > 1 && typeof handle === 'string') err = new Error('write handle argument cannot be string')
		else if (!self.writable) err = new Error('ipc not available')
		else {
			try {
				result = process.send.apply(process, args)
			} catch (e) {
				err = e
			}
			if (!err) self.emit('drain')
		}
		if (err) internalDestroy(cb, [err])
		else if (cb) {
			var cbArgs = []
			if (err) cbArgs.push(err)
			cb.apply(this, cbArgs)
		}
		return result
	}
1055143
def _write(self, s):
        """"""
        try:
            write = self.sock.write
        except AttributeError:
            # Works around a bug in python socket library
            raise IOError('Socket closed')
        else:
            while s:
                n = write(s)
                if not n:
                    raise IOError('Socket closed')
                s = s[n:]
515283
def write(self, items):
        
        if self._read_only:
            raise IOError("Cannot write, Connector created as Read Only")

        # Uploading info to the new ES
        docs = []
        for item in items:
            doc = {
                "_index": self._es_index,
                "_type": "item",
                "_id": item["_id"],
                "_source": item["_source"]
            }
            docs.append(doc)
        # TODO exception and error handling
        helpers.bulk(self._es_conn, docs)
        logger.info(self.__log_prefix + " Written: " + str(len(docs)))
728635
def write(self, data):
        """"""
        # I don't want to add a separate 'Client disconnected' logic for sending.
        # Therefore I just ignore any writes after the first error - the server
        # won't send that much data anyway. Afterwards the read will detect the
        # broken connection and we quit.
        if self._ignore_write_operations:
            return
        assert self.is_connected()
        try:
            self._connection.send(data.encode('ascii'))
        except socket.error:
            self.close()
            self._ignore_write_operations = True
545463
function(id, msg, meta) {
        var socket = openSocketsById[id];
        if (socket) {
          return socket.write('0|' + msg + '|' + meta)
        } else {
          return false;
        }
      }