Ethernet communication

At this moment sending data to the client is working. Thanks for reporting to look at zoomkat sketches. They are very helpful.
I still am thinking what's the best way sending from the server to the client.
Now I just do a client.print() with a constant value

server

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

byte mac[] = { 0xEE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 1, 111 };

EthernetServer server = EthernetServer(80);
 
void setup()
{
  Ethernet.begin(mac, ip);
  server.begin();
  Serial.begin(9600);  
  pinMode(4,OUTPUT);
  delay(1000);  
}

void loop()
{  
   
  EthernetClient client = server.available();
  if (client) {    
    while (client.connected()) {
      if (client.available()) {
    
      client.print("on");
        
      }
          delay(1);
          //stopping client
          client.stop();

        }
      }
    }

client

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

char reader[2];
int i;

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 1, 110 };
byte server[] = { 192, 168, 1, 111 };


EthernetClient client;

void setup()
{
  pinMode(4,OUTPUT);
  Ethernet.begin(mac, ip);
  Serial.begin(9600);
  delay(1000);
}

void loop()

{  
   if (client.connect(server, 80)) 
   {
    Serial.println("connected");
    client.println();
   } else {
    Serial.println("connection failed");
    Serial.println();
  }

  while(client.connected() && !client.available()) delay(1); //waits for data
  while (client.connected() || client.available()) //connected or data available
  {
    for(i=0; i<2; i++)
    {
      reader[i] = client.read();
    } 
    Serial.print(reader[0]);
    Serial.print(reader[1]);
    
    if ( reader[0] == 'o' && reader[1] == 'n' )
    {
      digitalWrite(4, HIGH);
    } 
    
     if ( reader[0] == 'o' && reader[1] == 'f' )
    {
      digitalWrite(4, HIGH);
    } 
    
  }
  
  Serial.println();
  Serial.println("disconnecting.");
  Serial.println("==================");
  Serial.println();
  client.stop();
}