Can anything in my code cause this arduino shield to lose network connectivity?

I have an arduino uno wth an ethernet shield. The intent of my device is to act a webserver that accepts commands from a webpage form. It then sends signals to a servo (to cause a camera to zoom) and/or a pan/tilt camera motor that the camera sits on. Everything works but my arduino occassionally looses network connectivity every few minutes. My last ditch effort is believing that my configuration might have a conflict causing this to fail. I’m new to this and have based my code on a variety of sources. Can anyone see a conflict or bad practice?

#include <SPI.h>
//#include <Ethernet.h>
#include <EthernetV2_0.h>
#include <Servo.h>

#define left 8  //Pin 11/8 controls left pan
#define right 4 //Pin 3 controls right pan
#define up 7   //Pin 10/7 controls up tilt
#define down 2     //Pin 9 controls down tilt

int varx = 0;  // The x-axis variable to store the value coming from the Nunchuck
int vary = 0;  // The x-axis variable to store the value coming from the Nunchuck
//00:80:91:ac:c2:db
// MAC address from Ethernet shield sticker under board
byte mac[] = {
  0x00, 0x80, 0x91, 0xac, 0xc2, 0xdb
};
//byte mac[] = { 0x90,0xa2,0xda,0x0e,0xd0,0x93 };
IPAddress ip(192, 168, 1, 224); // IP address, may need to change depending on network
EthernetServer server(80);  // create a server at port 80

String HTTP_req;          // stores the HTTP request

Servo myservo;  // create servo object to control a servo 
int pos = 0;    // variable to store the servo position 

int startPosition = 0;
String directionCommand;
int startNudgePosition = 0;
String directionNudgeCommand;
int startStopPosition = 0;
String stopCommand;
int startTimePosition = 0;
String timeCommand;
int startSpeedPosition;
String speedCommand;

int timevalue = 0;
int speedvalue = 0;


void setup()
{
    myservo.attach(9);  // attaches the servo on pin 9 to the servo object 
   
    Ethernet.begin(mac, ip);  // initialize Ethernet device
    server.begin();           // start to listen for clients
    Serial.begin(9600);       // for diagnostics
    printServerStatus();
}

void loop()
{  

  EthernetClient client = server.available();  // try to get client

    if (client) {  // got client?
        boolean currentLineIsBlank = true;
        while (client.connected()) {
            if (client.available()) {   // client data available to read
                char c = client.read(); // read 1 byte (character) from client
                HTTP_req += c;  // save the HTTP request 1 char at a time
                // last line of client request is blank and ends with \n
                // respond to client only after last line received
                if (c == '\n' && currentLineIsBlank) {
                    //send a standard http response header
                    client.println("HTTP/1.1 200 OK");
                    client.println("Content-Type: text/html");
                    client.println("Connection: close");
                    client.println();
                    client.println("<script>window.history.back();</script>");
                    if (HTTP_req.indexOf("favicon") == -1) {
                    ProcessCheckbox(client);
                    }

                    //Serial.print(HTTP_req);
                    HTTP_req = "";    // finished with request, empty string
                    break;
                }
                // every line of text received from the client ends with \r\n
                if (c == '\n') {
                    // last character on line of received text
                    // starting new line with next character read
                    currentLineIsBlank = true;
                } 
                else if (c != '\r') {
                    // a text character was received from client
                    currentLineIsBlank = false;
                }
            } // end if (client.available())
        } // end while (client.connected())
        delay(1);      // give the web browser time to receive the data
        client.stop(); // close the connection
    } // end if (client)
}


// switch LED and send back HTML for LED checkbox
void ProcessCheckbox(EthernetClient cl)
{

 
startPosition = HTTP_req.indexOf("D=");
directionCommand = HTTP_req.substring(startPosition+2,startPosition+3);

startNudgePosition = HTTP_req.indexOf("N=");
directionNudgeCommand = HTTP_req.substring(startNudgePosition+2,startNudgePosition+3);

startTimePosition = HTTP_req.indexOf("&time=");
timeCommand = HTTP_req.substring(startTimePosition+6,startTimePosition+7);

//*Serial.println();
//*Serial.print("Direction Value: "+directionCommand);
//*Serial.println();
//*Serial.print("Nudge Value: "+directionNudgeCommand);
//*Serial.println();
//*Serial.print("Time Value: "+timeCommand);
//*Serial.println();

  varx = 80;
  vary = 80;

  if (directionCommand =="R" || directionCommand =="G") {  // see if checkbox was clicked
      analogWrite(right, abs(varx)*2);
      digitalWrite(left, LOW);
//*      Serial.println("moveright");

  }else if (directionCommand =="L" || directionCommand =="C") {  // see if checkbox was clicked
      analogWrite(left, abs(varx)*2);
      digitalWrite(right, LOW);
//*      Serial.println("moveleft");

  }else if (directionCommand =="U") {  // see if checkbox was clicked
      analogWrite(up, abs(vary)*2);
      digitalWrite(down, LOW);
//*      Serial.println("moveup");

  }else if (directionCommand =="D") {  // see if checkbox was clicked
      analogWrite(down, abs(vary)*2);
      digitalWrite(up, LOW);
//*      Serial.println("movedown");

  }else if (directionCommand =="X") {  // see if checkbox was clicked
      analogWrite(right, LOW);
      analogWrite(left, LOW);
      analogWrite(up, LOW);
      analogWrite(down, LOW);
//*      Serial.println("stop!!!!!");

  }else if (directionCommand =="F") {  // Zoom In Full
      zoomIn(1000);
  }else if (directionCommand =="T") {  // Zoom In x2
      zoomIn(250);
  }else if (directionCommand =="I") {  // Zoom In
      zoomIn(100);
      
  }else if (directionCommand =="O") {  // Zoom Out
      zoomOut(100);
  }else if (directionCommand =="P") {  // Zoom Out x2
      zoomOut(250);
  }else if (directionCommand =="B") {  // Zoom Out Full
      zoomOut(1000);

  }else if (HTTP_req.indexOf("favicon") > -1) {  // see if favicon request
      //Serial.print("Do nothing for favicon request!");
  }else{
//*      Serial.println("Right/Left is NOT Checked //");
      stopAll();
  }

    //if only nudging then delay and all stop
      if(directionNudgeCommand == "2"){
        delay(100);
        stopAll();
      }else if(directionNudgeCommand == "1"){
        delay(25);
        stopAll();      
      }else{
        //continue with full move
      }

startPosition = 0;
startTimePosition = 0;
startSpeedPosition = 0;
directionCommand = "";


}

void zoomIn(int zoomDelay){
//*Serial.print("Zoom In");
  for(pos = 90; pos <= 105; pos += 2) // goes from 0 degrees to 180 degrees 
  {                                  // in steps of 1 degree 
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);
//*    Serial.println(pos);
  } 
    delay(zoomDelay);
    zoomReset();

}

void zoomOut(int zoomDelay){
//*  Serial.print("Zoom Out");
  for(pos = 90; pos >= 75; pos -= 2) // goes from 0 degrees to 180 degrees 
  {                                  // in steps of 1 degree 
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);
//*    Serial.println(pos);
  } 
    delay(zoomDelay);
    zoomReset(); 
 }

  void zoomReset(){
//*  Serial.print("Zoom Reset");
      myservo.write(90);
      delay(15);
  }

void stopAll(){
      analogWrite(right, LOW);
      analogWrite(left, LOW);
      analogWrite(up, LOW);
      analogWrite(down, LOW);
      digitalWrite(left, LOW);
      digitalWrite(right, LOW);
      digitalWrite(up, LOW);
      digitalWrite(down, LOW);
//*      Serial.print("stopAll");
//*      Serial.println();
}

void printServerStatus()
{
	Serial.print("Server address:");
	Serial.println(Ethernet.localIP());
}

Thanks for any insight!

When you say it loses network connectivity, do you mean the server quits responding? Does it also quit responding to a ping?

Maybe you are using all your sockets? Add this to your sketch and call it before each connection.

#include <utility/w5200.h>

byte socketStat[MAX_SOCK_NUM];

void ShowSockStatus()
{
  for (int i = 0; i < MAX_SOCK_NUM; i++) {
    Serial.print(F("Socket#"));
    Serial.print(i);
    uint8_t s = W5100.readSnSR(i);
    socketStat[i] = s;
    Serial.print(F(":0x"));
    Serial.print(s,16);
    Serial.print(F(" "));
    Serial.print(W5100.readSnPORT(i));
    Serial.print(F(" D:"));
    uint8_t dip[4];
    W5100.readSnDIPR(i, dip);
    for (int j=0; j<4; j++) {
      Serial.print(dip[j],10);
      if (j<3) Serial.print(".");
    }
    Serial.print(F("("));
    Serial.print(W5100.readSnDPORT(i));
    Serial.println(F(")"));
  }
}

Call it here.

    if (client) {  // got client?
        ShowSockStatus();
        boolean currentLineIsBlank = true;

The status values are
0x0 = available
0x14 = waiting for connection
0x17 = connected
0x1c = connected waiting for close
0x22 = UDP socket

edit: I forgot to mention this. Check your CAT5 cable! Insure it is a good cable and plugged in completely.