Socket Server Pin Control

I am currently getting unexpected behavior. What is happening is the first time I send any data to the socket both relay's turn on. I want to actually send a string like PIN6L, or PIN6H but for testing purposes I am trying to just use a single digit.

Ideally I want to send many items Like P6LD2P7H which would be translated to:
Pin6 Low Delay 2000 Pin7High

But I can not seem to make even simple integer work with this. Any help would be appreciated.

// when the client sends the first byte, say hello:
  if (client) {
    if (!alreadyConnected) {
      // clead out the input buffer:
      client.flush();
      Serial.println("We have a new client");
      client.println("Hello, client!");
      alreadyConnected = true;
    }

    if (client.available() > 0) {
      // read the bytes incoming from the client:
      int thisChar = client.read();
      // echo the bytes back to the client:
      Server.write(thisChar);
      // echo the bytes to the server as well:
      Serial.write(thisChar);
      if (thisChar == 1){
        digitalWrite(relay[0], LOW);
      }
      if (thisChar = 2){
        digitalWrite(relay[0], HIGH);
      }      
      if (thisChar = 3){
        digitalWrite(relay[1], LOW);
      }
      if (thisChar = 4){
        digitalWrite(relay[1], HIGH);
      }            
    }
  }
}
      Serial.write(thisChar);

Why are you using a binary function to send data to a serial port? Where is that data going?

Why on earth would you use char in the name of a variable of type int?

The Stream-based read() functions return an int so that they can tell you that you tried to read data that isn't there, if you do that. The data is returned in the low order byte. If you never try to read data that isn't there, you can store the returned value in a byte or char variable, and never lose any data.

If you did that, you'd see that the char variable contained '1', not 1.

You are using '=' where you mean '==':

      if (thisChar = 2){     
      if (thisChar = 3){
      if (thisChar = 4){