serproxy - connection refused ?

Hello,

I send order to my Arduino with AS3 script and all is good but, sometimes(and only sometimes) system fail !
Serproxy said : Failed to open comm port- connection refused
Whyyyyy ?? =(

AS3 Code

import flash.display.Sprite;
import flash.net.Socket;
import flash.events.MouseEvent;


var _socket:Socket;

var _proxyAddress:String = "127.0.0.1";
var _proxyPort:uint = 5331;

_socket = new Socket();

function onClic1(pEvt:Event):void
{	                    

    _socket.connect(_proxyAddress, _proxyPort);
	
    var ENDOF_1:String = "E";
	
	trace ("marche");
	
	_socket.writeUTFBytes(ENDOF_1);//send this string value to arduino

	_socket.flush();
}

function onClicStop(pEvt:Event):void
{                  

    _socket.connect(_proxyAddress, _proxyPort);
	
    var ENDOF_S:String = "C";
	
	trace ("stop");
	
	_socket.writeUTFBytes(ENDOF_S);//send this string value to arduino

	_socket.flush();
}

btn1.addEventListener(MouseEvent.CLICK, onClic1);
btnStop.addEventListener(MouseEvent.CLICK, onClicStop);

ad sketch code

#include <Servo.h>

int demarre;//ARNO
int pinI1=8;//define I1 interface
int pinI2=11;//define I2 interface 
int speedpinA=9;//enable motor A
int spead =60;//define the spead of motor

void setup()
{
  pinMode(pinI1,OUTPUT);
  pinMode(pinI2,OUTPUT);
  pinMode(speedpinA,OUTPUT);
  Serial.begin(57600);
}

void loop()
{    
     if(Serial.available() >0)
  {
    demarre = Serial.read();
    if (demarre == 'E')
    {
     analogWrite(speedpinA,spead);//input a simulation value to set the speed
     digitalWrite(pinI2,HIGH);//horaire
     digitalWrite(pinI1,LOW);
     
    }else{
      if (demarre == 'C')
      {
       digitalWrite(speedpinA,LOW);   
      }
    }
  }
}