powered by Jive Software

java.net.SocketException caused by JabberD connection rate limiting

Hi, and thanks for the great library.

I’‘ve been using this for just a few days, do i don’‘t know whether this is because of my ignorance, but here’'s the scenario:

First, the code:

import org.jivesoftware.smack.*;

public class Connector{

private String server = “localhost”;

XMPPConnection conn = null;

private boolean connect() {

try {

conn = new XMPPConnection(server);

return conn.isConnected();


catch (XMPPException xmppe) {

return false;



public static void main(String[] args){

Connector sm1 = new Connector();




When this is run repeatedy, the JabberD server starts connection rate limiting, and prints this message in its window:

20030418T05:06:13: (io_select): is being connection rate limited

This trace is returned by the code:

java.net.SocketException: Software caused connection abort: recv failed

at java.net.SocketInputStream.socketRead0(Native Method)

at java.net.SocketInputStream.read(SocketInputStream.java:129)

at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:406)

at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:446)

at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:180)

at java.io.InputStreamReader.read(InputStreamReader.java:167)

at java.io.BufferedReader.read1(BufferedReader.java:185)

at java.io.BufferedReader.read(BufferedReader.java:261)

at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:2958)

at org.xmlpull.mxp1.MXParser.more(MXParser.java:2975)

at org.xmlpull.mxp1.MXParser.parseProlog(MXParser.java:1433)

at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1418)

at org.xmlpull.mxp1.MXParser.next(MXParser.java:1137)

at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:287)

at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:74)

at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:99)

java.net.SocketException: Software caused connection abort: socket write error

at java.net.SocketOutputStream.socketWrite0(Native Method)

at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)

at java.net.SocketOutputStream.write(SocketOutputStream.java:136)

at sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:334)

at sun.nio.cs.StreamEncoder$CharsetSE.implFlushBuffer(StreamEncoder.java:402)

at sun.nio.cs.StreamEncoder$CharsetSE.implFlush(StreamEncoder.java:406)

at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:150)

at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:213)

at java.io.BufferedWriter.flush(BufferedWriter.java:230)

at org.jivesoftware.smack.PacketWriter.writePackets(PacketWriter.java:156)

at org.jivesoftware.smack.PacketWriter.access$000(PacketWriter.java:65)

at org.jivesoftware.smack.PacketWriter$1.run(PacketWriter.java:85)


Note that all bar the last line is stderr, while the last line is stdout.

Thanks again.

I’‘m not sure what the question is…? This sounds like a server issue where it isn’'t allowing many connections in a row due to karma settings.



Yes, it’‘s rigth. For the ones who don’'t no, the karma defenitions is where we define the configurations of the connections.

Stuffs like time to live, number of connections in a time… to prevent the congestion on the server and in worst case prevent it goes down!

And probably it’'s that your problem. You have two solutions:

  • Don’'t do mass connectino

  • Or, raise the karma connection limit.

I hoppe that this short info helps in your problem.