AS3 Socket problem

Hola!
I’m writing a client in Flash using the AS3 Socket class.
The problem is occuring when I’m sending packets too fast,
here is a example:

The first packet is as it should, but the second packet is sending the data twice!
Here is the code I’m using to send packets:


public function login(id:String, pw:String):void {    
        if (socket.connected) {
                socket.writeUTFBytes(String(headerLogin) + String(int(id.length)) + id + String(int(pw.length)) + pw);
                socket.flush();
        }else {
                 trace("[Socket] Can't send data because you are not connected!");
        }
}

This is the only place where socket.writeUTFBytes is used, so there is no mistake with a forgotten function or so.

If you have any clue why it’s writing the data twice, don’t hesitate to post :cool:
Thanks in advance,
~Tompa