Arduino Ethernet connection

Hi,
i would like to send data from one arduino to another via ethernet. I have two Arduino Ethernet boards and the are connected to the Router. I used code from Arduino website and they connect with each other but result of client.available() is 0. Could someone help and explain me where have i mistake?

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

// network configuration.  gateway and subnet are optional.

 // the media access control (ethernet hardware) address for the shield:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };  
//the IP address for the shield:
byte ip[] = { 192,168,1,1 };    
// the router's gateway address:
//byte gateway[] = { 10, 0, 0, 1 };
// the subnet:
//byte subnet[] = { 255, 255, 0, 0 };

// telnet defaults to port 23
EthernetServer server = EthernetServer(80);

int a = 5;
void setup()
{
  // initialize the ethernet device
 Ethernet.begin(mac, ip /*gateway, subnet*/);

  // start listening for clients
  server.begin();
  Serial.println("Server is ready");
}

void loop()
{
  // if an incoming client connects, there will be bytes available to read:
  EthernetClient client = server.available();
  if (client == true) {
        delay(1000);
    // read bytes from the incoming client and write them back
    // to any clients connected to the server:
    server.write(client.read());
    server.write(a);
  }
  Serial.println(client);
  Serial.println(server.available());
  delay(4000);
}
#include <Ethernet.h>
#include <SPI.h>


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

EthernetClient client;

void setup()
{
  Ethernet.begin(mac, ip);
  Serial.begin(9600);

  delay(1000);

  Serial.println("connecting...");

  if (client.connect(server, 80)) {
    Serial.println("connected");
    client.println("GET /search?q=arduino HTTP/1.0");
    client.println(" ");
  } else {
    Serial.println("connection failed");
  }
}

void loop()
{ 
  if (client.available()) {
    char c = client.read();
    Serial.print(c);
  }
  Serial.println(client.available());
  Serial.println(client.connected());
  delay(4000);
  if (!client.connected()) {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();
  }
}

Thank you for the answer

what is the IP address of the router? they usually have .1, but you used it for Arduino
you connect to port 80 and listen on port 23
you don't check client.available() on server

this applies to Ethernet library too. only replace WiFi with Ethernet:

"they connect with each other but result of client.available() is 0. "

Have you checked the connected client list in the router to see the IP addresses assigned to the two ethernet boards? How did you get them to connect to each other? I think a server notes that there is a client available when a client is actually trying to make a connection to the server.