STM32Ethernet hangs on after disconnecting

Hello, I'm using Nucleo-F429Zi in Arduino IDE. It has an Ethernet connection on it. I used the basic example "WebClient" to create a client and connect it to a server that is created in my PC using the "TCPClientServer" application. I modified the basic example to fit my application. It works well until once disconnection. After that,2 packets sent and then the code hangs on and nothing happens!
this is my simple code and serial print screenshot:

#include <LwIP.h>
#include <STM32Ethernet.h>

IPAddress server(10, 0, 0, 103);


EthernetClient client;
byte LINE_CNTRLR_Data_To_Server[200];

void setup() {
  // Open serial communications and wait for port to open:
  delay(2000);
  Serial.begin(9600);
  delay(2000);
  while(Ethernet.begin()==0){
    Serial.println("waiting for DHCP server!");
    delay(1000); 
  }
  Serial.println(Ethernet.localIP());
  
for(int i=0;i<200;i++)
    LINE_CNTRLR_Data_To_Server[i]=i;
  Serial.println("connecting...");
}

void loop() {
  SEND_ETHERNET_DATA();
  delay(4000);
}


void SEND_ETHERNET_DATA(){
   // if you get a connection, report back via serial:
  client.connect (server,  48569);
  if (client.connected()){
      Serial.println("connected");

      int writen_bytes_num=client.write(LINE_CNTRLR_Data_To_Server, 200);
      Serial.print(writen_bytes_num);    
      Serial.println(" Bytes  Sent!");    
      client.flush();
      client.stop();
  }
  else {
    client.stop();    
    Serial.println("connection failed");
    
  }
 

}