Processing controls servos over ethernet for about 6 seconds, arduino freezes

So, amazingly, Ive gotten these two sketches to work over ethernet, but arduino seems to freeze after about six seconds.
Im wondering if Im just flooding it with data and it cant handle it. When I restart the processing sketch it starts over just fine.
Thanks in advance for any help!
PS. Id also like to add a watchdog timer that shuts off the laser if no commands are recieved for likem, 30 seconds.
I played around with it before and it would work, but it would shut off the laser no matter what, after the specified time and wouldnt recieve any more commands.

Arduino sketch:

/* attempting to program UNO with ethernet shield to accept commands from a client. 
copied code almost exactly from mouse_test
PWM pins remaining after ethernetshield are 3, 5, 6, and 9.

*/
#include <Servo.h>
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //mac address of eth shield
IPAddress ip (192,168,1,177);//permanent local IP address
IPAddress gateway (192,168,1,1); //router address
IPAddress subnet (255,255,255,0);

EthernetServer server(80); //using port 80
boolean alreadyConnected = false;


Servo servoX, servoY, servoA, servoB;
const int laserPin = 8;
const int buzzerPin = 7;
bool laser = false;
int x1, y1, a1, b1;


void setup() {
  servoX.attach(3);
  servoY.attach(5);
  servoA.attach(6);
  servoB.attach(6);
  pinMode(laserPin, OUTPUT);
  pinMode(buzzerPin, OUTPUT);
  digitalWrite(laserPin, LOW);
  servoX.write(90);
  servoY.write(90);
  Ethernet.begin(mac, ip, gateway, subnet);
  server.begin();
  Serial.begin(19200);
  
  Serial.print("Web server address:");
  Serial.println(Ethernet.localIP());
  
}

void loop() {
  a1 = servoA.read();
  b1 = servoB.read();
  EthernetClient client = server.available();
  if (client) {
    if (!alreadyConnected){
      client.flush();
      Serial.println("Disconnected.");
      alreadyConnected = true;
    }
    while (client.connected()){
      
      
      delay(1);
      
      static int v = 0;
      if (client.available()>0){
        char ch = client.read();
        switch(ch) {//read incomming characters from processing and handle the case by case
          case '0'...'9'://0-9 are coordinates
            v = v *10 + ch - '0';
            break;
            
          case 'x'://signifies end of x coordinate.
            x1 = map(v, 0, 180, 160, 0);
            servoX.write(x1);
            v = 0;
            break;
            
          case 'y': //end of y coordinate
            y1 = map(v, 0, 180, 10, 170);
            servoY.write(y1);
            v = 0;
            break;
            
          case 'l'://turns laser on or off
            laserOnOff();
            break;
            
          case 'u'://moves servoA up and sends data back to processing to draw a position bar on screen if in range.
            a1 += 2;
            if (a1 >= 150){
              a1 = 150;
            }
            servoA.write(a1);
            if (a1 < 150){//if servoA is in range, tell processing to move position bar.
              client.write("2");
            }
            break;
            
          case 'd':
            a1 -= 2;
            if (a1 <= 20){
              a1 = 20;
            }
            servoA.write(a1);
            if (a1 > 20){
              client.write("3");
            }
            break;
            
          case 'a':
            b1 -= 2;
            if (b1 <= 20){
              b1 = 20;
            }
            servoB.write(b1);//same for servoB
            if (b1 > 20){
              client.write("4");
            }
            break;
           
          case 's':
            b1 += 2;
            if (b1 >= 160){
              b1 = 160;
            }
            servoB.write(b1);
            if (b1 < 160){
              client.write("5");
            }
            break;
          
          case 'b'://fires buzzer while mouse button is held.
            digitalWrite(buzzerPin, HIGH);
            break;
          case 'n':
            digitalWrite (buzzerPin, LOW);
            break;
        }   
      }
    } client.flush();
  }        
}
void laserOnOff(){//turns laser on/off.
  if (laser == false){
    digitalWrite (laserPin, HIGH);
    //client.write("1");
    laser = true;
  }
  else if (laser == true){
    digitalWrite(laserPin, LOW);
    //client.write("0");
    laser = false;
  }
}

Processing sketch:
Any lines with “serial” in them have been commented out and replaced by client commands.

//import processing.serial.*;
import processing.net.*;
Client myClient;
int xpos=90;
int ypos=90;
int a=320; // position of green servoA position bar on left side of screen.
int b=320; //position of red servoB position bar on bottom of screen.
boolean laser = false;
boolean ab=true; //switches control of A and B servos with mousewheel.
//Serial port;

void setup() {
  size(640, 640); //sets size of window
  frameRate(50);
  //println(Serial.list()); //list com ports
  //port = new Serial(this, Serial.list()[0], 19200);
  myClient = new Client(this, "192.168.1.177", 80);
}

void draw() {//draws window and graphics.
  if (mousePressed && (mouseButton == RIGHT)) {//sends buzzer on command.
    //port.write("b");
    myClient.write("b");
    
  }
  else{
   // port.write("n");//sends buzzer off command.
   myClient.write("n");
  }
  
  if (keyPressed){//pressing 'a' activates control of servoA with mousewheel.
    if (key == 'a'){
      ab = true;
    }
    else if (key == 'b'){
      ab = false;
    }
  }
  
  //if (port.available()>0){//check to see if any thing sent back from arduino on serial bus.
  if (myClient.available() > 0){  
    //int ls = port.read();
    int ls = myClient.read();
    switch(ls){
      case '1'://turn laser on and draw dot/line.
        laser = true;
        break;
      case '0': // turn laser off.
        laser = false;
        break;
      case '2'://move servoA position bar down.
        a = a + 7;
        break;
      case '3'://move servoA position bar up.
        a = a - 7;
        break;
      case '4'://move servoB position bar left.
        b = b - 7;
        break;
      case '5'://move servoB position bar right.
        b = b + 7;
        break;        
    }
  }
  fill(175);
  rect(0, 0, 640, 640);// grey rectangle.
  fill(0,0,0);
  textSize(12);
  text("Click left mouse to toggle laser on and off. Buzzer stays on while right mouse is held.", 20, 30);
  text("Press 'a' to control Servo A with mouse wheel. Press 'b' for Servo B.", 20, 60);
  fill(150, 150, 150);
  ellipse(mouseX, mouseY, 40, 40); //outer target ring.
  
  if (laser) {//checks to see if arduino sent laser on command, if it did, draw dot and line to it.
    fill(255, 0, 0);
    ellipse(mouseX, mouseY, 10, 10);//red dot
    stroke(150, 100, 0);
    line(320, 640, mouseX, mouseY);//line to red dot
  }
  fill(0, 255, 0); //draws green servoA position bar
  rect(0, a+10, 20, 10);
  fill(255, 255, 0);//draws servoB position bar.
  rect(b+10, 620, 10, 20);
  update(mouseX, mouseY);//sends mouse position to update() function
}
void update(int x, int y) {
  //calculate servo position from mouseX/Y:
  xpos = x/4;
  ypos = y/4;
  //output to servo (0-180):
  //port.write(xpos + "x");
  //port.write(ypos + "y");
  myClient.write(xpos + "x");
  myClient.write(ypos + "y");
}
void mouseClicked() {//sends laser command to arduino
  if (mouseButton == LEFT){
    //port.write("l");
    myClient.write("l");
  }
  /*if (mouseButton == CENTER){
    if (ab == false){
      ab = true;
    }
    else if (ab == true){
      ab = false;
    }
  }*/
}

void mouseWheel(MouseEvent event){//sends commands to arduino to move servoA or B
  float e = event.getAmount();
  if(ab == true){
    if (e > 0){
      //port.write("u");//send up command.
      myClient.write("u");
    }
    if (e < 0){
      //port.write("d");//send down command.
      myClient.write("d");
    }
  }
  else if (ab == false){
    if (e > 0){
      //port.write("a");//send left command.
      myClient.write("a");
    }
    if (e < 0){
      //port.write("s");//send right command.
      myClient.write("s");
    }
  }
}

Just noticed all this at the bottom of Processing. I have no idea what it means.

java.lang.NullPointerException at processing.net.Client.write(Unknown Source) at processing.net.Client.write(Unknown Source) at eth_mouse_test.update(eth_mouse_test.java:112) at eth_mouse_test.draw(eth_mouse_test.java:102) at processing.core.PApplet.handleDraw(PApplet.java:2305) at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:243) at processing.core.PApplet.run(PApplet.java:2176) at java.lang.Thread.run(Thread.java:662)

It seems to be that Processing is freezing, not Arduino.

Any ideas?

Is the below intentional?

servoA.attach(6);
servoB.attach(6);

NO!

Thanks! lol. maybe that will help!