No longer use packet reader/writer.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@1800 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Matt Tucker 2003-01-17 07:12:41 +00:00 committed by mtucker
parent 5e4d91c269
commit 8fb4e6a747
1 changed files with 9 additions and 11 deletions

View File

@ -103,8 +103,7 @@ public class Chat {
// Automatically assign the next chat ID. // Automatically assign the next chat ID.
chatID = nextID(); chatID = nextID();
messageCollector = connection.getPacketReader().createPacketCollector( messageCollector = connection.createPacketCollector(new ThreadFilter(chatID));
new ThreadFilter(chatID));
} }
/** /**
@ -119,8 +118,7 @@ public class Chat {
this.participant = participant; this.participant = participant;
this.chatID = chatID; this.chatID = chatID;
messageCollector = connection.getPacketReader().createPacketCollector( messageCollector = connection.createPacketCollector(new ThreadFilter(chatID));
new ThreadFilter(chatID));
} }
/** /**
@ -158,7 +156,7 @@ public class Chat {
public void sendMessage(String text) throws XMPPException { public void sendMessage(String text) throws XMPPException {
Message message = createMessage(); Message message = createMessage();
message.setBody(text); message.setBody(text);
connection.getPacketWriter().sendPacket(message); connection.sendPacket(message);
} }
/** /**
@ -187,7 +185,7 @@ public class Chat {
// Force the chatID since the user elected to send the message // Force the chatID since the user elected to send the message
// through this chat object. // through this chat object.
message.setThread(chatID); message.setThread(chatID);
connection.getPacketWriter().sendPacket(message); connection.sendPacket(message);
} }
/** /**
@ -206,8 +204,8 @@ public class Chat {
} }
/** /**
* Returns the next available message in the chat. The method will block * Returns the next available message in the chat. The method call will block
* indefinitely (won't return) until a message is available. * (not return) until a message is available.
* *
* @return the next message. * @return the next message.
*/ */
@ -216,9 +214,9 @@ public class Chat {
} }
/** /**
* Returns the next available message in the chat. The method will block * Returns the next available message in the chat. The method call will block
* for up to the timeout. If a message still isn't available then, <tt>null</tt> * (not return) until a packet is available or the <tt>timeout</tt> has elapased.
* will be returned. * If the timeout elapses without a result, <tt>null</tt> will be returned.
* *
* @param timeout the maximum amount of time to wait for the next message. * @param timeout the maximum amount of time to wait for the next message.
* @return the next message, or <tt>null</tt> if the timeout elapses without a * @return the next message, or <tt>null</tt> if the timeout elapses without a