Lines Matching refs:packet
23 import org.jivesoftware.smack.packet.Packet;
50 * Creates a new packet writer with the specified connection.
78 * Sends the specified packet to the server.
80 * @param packet the packet to send.
82 public void sendPacket(Packet packet) {
84 // Invoke interceptors for the new packet that is about to be sent. Interceptors
85 // may modify the content of the packet.
86 connection.firePacketInterceptors(packet);
89 queue.put(packet);
99 // Process packet writer listeners. Note that we're using the sending
101 connection.firePacketSendingListeners(packet);
106 * Starts the packet writer thread and opens a connection to the server. The
107 * packet writer will continue writing packets until {@link #shutdown} or an
119 * Shuts down the packet writer. Once this method has been called, no further
133 * Cleans up all resources used by the packet writer.
141 * Returns the next available packet from the queue for writing.
143 * @return the next packet for writing.
146 Packet packet = null;
147 // Wait until there's a packet or we're done.
148 while (!done && (packet = queue.poll()) == null) {
158 return packet;
167 Packet packet = nextPacket();
168 if (packet != null) {
169 writer.write(packet.toXML());
180 Packet packet = queue.remove();
181 writer.write(packet.toXML());