Here is the client code cut and paste to try
//4 digital signals read from 2 servers
// 151,152 provide 1 2
//In addition 1 input on pin 4 active low
//Pin4 writes serial 1,
//Pin 3 digital output
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0x90, 0xA2, 0xDE, 0x0E, 0xC0, 0x0E };
IPAddress server1(192,168,1,151);
IPAddress server2(192,168,1,152);
IPAddress ip(192,168,1,160);
EthernetClient client;
int Output = 3;
int Input = 4;
void setup() {
pinMode(Output,OUTPUT);
pinMode (Input,INPUT);
Ethernet.begin(mac, ip);
Serial.begin(9600);
Serial.print(0);
}
void loop(){
if(client.connect(server1,8151)){
client.println();
}
delay(100);
if (client.available())
{
char c = client.read();
if(int(c) == 49)
{
digitalWrite (Output, HIGH);
Serial.print(1);
}
char d = client.read();
if(int(d) == 50)
{
digitalWrite (Output, HIGH);
Serial.print(2);
}
delay(100);
digitalWrite (Output, LOW);
Serial.print(0);
}
client.stop();
if(client.connect(server2,8152)){
client.println();
}
delay(100);
if (client.available())
{
char c = client.read();
if(int(c) == 49)
{
digitalWrite (Output, HIGH);
Serial.print(1);
}
char d = client.read();
if(int(d) == 50)
{
digitalWrite (Output, HIGH);
Serial.print(2);
}
delay(100);
digitalWrite (Output, LOW);
Serial.print(0);
}
client.stop();
if (digitalRead(Input) == HIGH){
Serial.print(4);
digitalWrite (Output, HIGH);
delay(100);
}
}