write packet to given interfaces, default is broadcast to all interfaces
177991
def send(self, packet, interfaces=None):
        """"""
        interfaces = interfaces or self.interfaces  # default to all interfaces
        interfaces = interfaces if hasattr(interfaces, '__iter__') else [interfaces]

        for interface in interfaces:
            for f in self.filters:
                packet = f.tx(packet, interface)  # run outgoing packet through the filters
            if packet:
                # if not dropped, log the transmit and pass it to the interface's send method
                # self.log("OUT     ", ("<"+",".join(i.name for i in interfaces)+">").ljust(30), packet.decode())
                interface.send(packet)
1253786
function writeToEngine(encodedPackets) {
    if (opts.volatile && !self.conn.transport.writable) return;
    for (var i = 0; i < encodedPackets.length; i++) {
      self.conn.write(encodedPackets[i], { compress: opts.compress });
    }
  }
1298199
def Serialize(self, writer):
        
        writer.WriteUInt32(self.Timestamp)
        writer.WriteUInt64(self.Services)
        # turn ip address into bytes
        octets = bytearray(map(lambda oct: int(oct), self.Address.split('.')))
        # pad to fixed length 16
        octets += bytearray(12)
        # and finally write to stream
        writer.WriteBytes(octets)
        writer.WriteUInt16(self.Port, endian='>')
552897
def write(self, request):
    """"""
    if FLAGS.sc2_verbose_protocol:
      self._log(" Writing request ".center(60, "-") + "\n")
      self._log_packet(request)
    self._write(request)
571764
protected void writeRegister(int register, int value) throws IOException {

        // create packet in data buffer
        byte packet[] = new byte[3];
        packet[0] = (byte)(register);     // register byte
        packet[1] = (byte)(value>>8);     // value MSB
        packet[2] = (byte)(value & 0xFF); // value LSB

        // write data to I2C device
        device.write(packet, 0, 3);
    }
1021089
@Override
   public void writeImport(Definition def, Writer out) throws IOException
   {
      out.write("package " + def.getRaPackage() + ";\n\n");

      if (def.isSupportEis())
      {
         out.write("import java.io.IOException;\n");
      }
      out.write("import java.io.PrintWriter;\n");

      if (def.isSupportEis())
      {
         out.write("import java.net.Socket;\n");
      }

      out.write("import java.util.ArrayList;\n");
      out.write("import java.util.Collections;\n");
      out.write("import java.util.HashSet;\n");
      out.write("import java.util.List;\n");
      out.write("import java.util.Set;\n");
      importLogging(def, out);
      out.write("import javax.resource.NotSupportedException;\n");
      out.write("import javax.resource.ResourceException;\n");
      out.write("import javax.resource.spi.ConnectionEvent;\n");
      out.write("import javax.resource.spi.ConnectionEventListener;\n");
      out.write("import javax.resource.spi.ConnectionRequestInfo;\n");
      out.write("import javax.resource.spi.LocalTransaction;\n");
      out.write("import javax.resource.spi.ManagedConnection;\n");
      out.write("import javax.resource.spi.ManagedConnectionMetaData;\n\n");
      out.write("import javax.security.auth.Subject;\n");
      out.write("import javax.transaction.xa.XAResource;\n\n");
   }
859913
function writeBundles(done) {
		debug('writeBundles()');
		async.forEachSeries(incBundles, function(packet, next) {
			packet.write(options, next);
		}, done);
	}
597191
def forward_packet(self, writer, packet, raw_packet):
        """"""
        peer = writer.get_extra_info('peername')
        log.debug(' %s:%s: forwarding data: %s', peer[0], peer[1], packet)
        if 'command' in packet:
            packet_id = serialize_packet_id(packet)
            command = packet['command']
            ack = yield from self.protocol.send_command_ack(
                packet_id, command)
            if ack:
                writer.write("20;00;OK;".encode() + CRLF)
            for _ in range(DEFAULT_SIGNAL_REPETITIONS-1):
                yield from self.protocol.send_command_ack(
                    packet_id, command)
        else:
            self.protocol.send_raw_packet(raw_packet)
718616
def send(self, packet, mac_addr=broadcast_addr):
        """"""
        if self.keep_listening:
            if mac_addr == self.broadcast_addr:
                for addr, recv_queue in self.inq.items():
                    recv_queue.put(packet)
            else:
                self.inq[mac_addr].put(packet)
                self.inq[self.broadcast_addr].put(packet)
        else:
            self.log("is down.")
1224205
void broadcast(Iterator<String> peers, Message message) {
    transport.broadcast(peers, message);
  }
470889
private void write(IoSession session, IoBuffer data) {
        IoBuffer dest = buffersMap.putIfAbsent(session,
                new IoBufferLazyInitializer(bufferSize));

        write(session, data, dest);
    }
722828
def write(self, frame):
        """"""
        if not isinstance(frame, FrameBase):
            raise PyVLXException("Frame not of type FrameBase", frame_type=type(frame))
        PYVLXLOG.debug("SEND: %s", frame)
        self.transport.write(slip_pack(bytes(frame)))
694375
@Override
	protected void send() {
		String msg = namespace + '|' + nodeID + '|' + port;

		// Send broadcast packet
		DatagramSocket udpSocket = null;
		try {
			byte[] bytes = msg.getBytes();
			udpSocket = new DatagramSocket();
			udpSocket.setBroadcast(true);
			udpSocket.setReuseAddress(udpReuseAddr);
			InetAddress address = InetAddress.getByName(udpAddress);
			DatagramPacket packet = new DatagramPacket(bytes, bytes.length, address, udpPort);
			udpSocket.send(packet);
			if (debug) {
				logger.info("Broadcast message submitted (namespace: " + namespace + ", node ID: " + nodeID + ", port: "
						+ port + ").");
			}
		} catch (Exception cause) {
			logger.error("Unable to send broadcast packet!", cause);
		} finally {
			try {
				if (udpSocket != null) {
					udpSocket.close();
				}
				udpSocket = null;
			} catch (Exception ignored) {
			}
		}
	}
417944
@Override
    public void write(RtpPacket packet, RTPFormat format) {
        // checking format
        if (format == null) {
            if (logger.isTraceEnabled()) {
                logger.trace("No format specified. Packet dropped!");
            }
            return;
        }

        boolean locked = false;
        try {
            locked = this.lock.tryLock() || this.lock.tryLock(5, TimeUnit.MILLISECONDS);
            if (locked) {
                safeWrite(packet, format);
            }
        } catch (InterruptedException e) {
            if (logger.isTraceEnabled()) {
                logger.trace("Could not aquire write lock for jitter buffer. Dropped packet.");
            }
        } finally {
            if (locked) {
                this.lock.unlock();
            }
        }
    }
1140474
def _write_packet(self, final):
        
        status = 1 if final else 0
        _header.pack_into(self._buf, 0, self._type, status, self._pos, 0, self._packet_no)
        self._packet_no = (self._packet_no + 1) % 256
        self._transport.sendall(self._buf[:self._pos])
        self._pos = 8
132065
protected void sendInfoPacket(String channel) {
		Tree msg = registry.getDescriptor();
		msg.put("ver", PROTOCOL_VERSION);
		msg.put("sender", nodeID);
		msg.put("seq", registry.getTimestamp());
		publish(channel, msg);
	}
463976
void writeInterfaces(final XMLExtendedStreamWriter writer, final ModelNode modelNode) throws XMLStreamException {
        writer.writeStartElement(Element.INTERFACES.getLocalName());
        final Set<String> interfaces = modelNode.keys();
        for (String ifaceName : interfaces) {
            final ModelNode iface = modelNode.get(ifaceName);
            writer.writeStartElement(Element.INTERFACE.getLocalName());
            writeAttribute(writer, Attribute.NAME, ifaceName);
            // <any-* /> is just handled at the root
            if (iface.get(Element.ANY_ADDRESS.getLocalName()).asBoolean(false)) {
                writer.writeEmptyElement(Element.ANY_ADDRESS.getLocalName());
            } else {
                // Write the other criteria elements
                writeInterfaceCriteria(writer, iface, false);
            }
            writer.writeEndElement();
        }
        writer.writeEndElement();
    }