wifi web server that doesn't slow down a robot?

Google is your friend for gaining knowledge of tcp/ip connections and http protocol. I set my code up such that the web server code is first just as a personal preference for following the code flow. When the server input buffer has data, the server code is run to provide the client with what is needed and then closed. Then the code flow moves on to other operations code being run. Does your bot code run as expected without the server code being included? Also, you probably need to detail what type of arduino you are using and what type of wifi hardware you are using (wifi shield or Ethernet shield connecting to a router). The servo pins 22 and 24 indicate you are not using a uno or similar board (mega?). Also, what pins are used for the sensors and what is the interrupt usage of the #include NewPing.h library? There may be conflicts between the NewPing.h library and Ethernet.h/SPI.h libraries.