ethernet and serial conflict

good day,
I am writing some code and I have a problem I cannot solve.
I am using an Arduino Leonardo with an ethernet Shield connecter to a router, I get some data from that and try to send it over a serial connection to an Arduino Uno.
I have checked the Serial Connection without the "ethernet code" and it works just fine, so i figured it's smth like o conflict between the ethernet communication and the serial one. I use the SoftwareSerial library but having used the Serial1 I had the same problem.
The part of the code i have the problem is:

if (Client.available() > 0) {
     char thisChar = Client.read();
     while (thisChar != '\n'){ 
     readString.concat(thisChar);
     thisChar =Client.read();
     }
     Serial.println(readString); //works
     if (readString.indexOf("connect")>=0)  Client.print("connection_ok\n"); //works
     Slave.print(readString); //here i get the problem, execution stops here
     response=getCommandSlave();  
     Client.print(response);
     response="";
     readString="";
     }

Yes, I have problems with my slaves too. I find a good whipping helps.

So does posting your entire code, along with links to any extra libraries you may be using.

We don't know what this "Slave" object is that you are referencing, so how we're supposed to help you is anyone's guess.

I am just using <Ethernet.h>, <SPI.h> and <SoftwareSerial.h>
Slave is the SoftwareSerial connection to the Arduino Uno I am using. I have checked that connection and it works just fine if i do not open any “ethernet connection” so I think there is a conflict between the ethernet and the serial connection.

#include <SPI.h>
#include <Ethernet.h>
#include <SoftwareSerial.h>

byte mac[] = { 
  0x90, 0xA2, 0xDA, 0x0D, 0x18, 0x2E };
IPAddress ip(192,168,1, 177);
IPAddress gateway(192,168,0, 1);
IPAddress subnet(255, 255, 0, 0);

String readString= String (30);
String response="";
SoftwareSerial Slave(2,3);
EthernetServer Server(23);
boolean alreadyConnected = false; 


void setup() {
  Ethernet.begin(mac, ip, gateway, subnet);
  Server.begin();
  Slave.begin(9600);
}

void loop() {
  
  EthernetClient Client = Server.available();
  
  if (Client) {
    if (!alreadyConnected) {
      Client.flush();    
      Serial.println("We have a new client");
      alreadyConnected = true;
    } 

  if (Client.available() > 0) {
     char thisChar = Client.read();
     while (thisChar != '\n'){ 
     readString.concat(thisChar);
     thisChar =Client.read();
     }
     Serial.println(readString);
     if (readString.indexOf("connect")>=0) 
     {Client.print("connection_ok\n");}
     Slave.print(readString);
     response=getCommandSlave(); 
     Client.print(response);
     response="";
     readString="";
     }
      
  }
}


String getCommandSlave(){
  String tempString= String (30);
  char thisChar = Slave.read();
  while (thisChar != '\n'){ 
    tempString.concat(thisChar);
    thisChar =Slave.read();
  }
  return tempString;
}

This is not correct.

  Ethernet.begin(mac, ip, gateway, subnet);

It should be

  Ethernet.begin(mac, ip, gateway, gateway, subnet);

Are you certain this is correct for your network?

IPAddress subnet(255, 255, 0, 0);

And the String data type is known to cause problems. I recommend switching these to character arrays.

String readString= String (30);
String response="";

I am using an Arduino Leonardo with an ethernet Shield

You don't show any code for serial startup for the Leonardo. Apparently the Leonardo needs a delay or similar when starting up its serial port.

if (Client.available() > 0) {
     char thisChar = Client.read();
     while (thisChar != '\n'){ 
     readString.concat(thisChar);
     thisChar =Client.read();
     }

So, if there is one character available, read and store every character until the carriage return shows up. Fail!