Ethernet shield as Web server and as a web client

Hello! I am currently using ethernet shield enc28j60. I am using the web client example of UIPEthernet.h library. I have tweaked the example and have successfully send data from my arduino into a database in the internet. However, i have trouble in making a sketch that can serve as an ethernet shield functioning as a web client and as a web server at the same time. I need to retrieve a value from my database so I can control a led in my arduino. I found a working sketch i can use to control a led over the internet, the code is below

#include <UIPEthernet.h>

byte mac[] = { 
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 
  192,168,254,113
 };

EthernetServer server(2222);

int LED = 6; //

void setup()
{
  Ethernet.begin(mac, ip);
  server.begin();
  pinMode(LED, OUTPUT);
}
#define BUFSIZ 100  //Buffer size for getting data
char clientline[BUFSIZ];  //string that will contain command data
int index = 0;  //clientline index
void loop()
{
  index=0;  //reset the clientline index
  EthernetClient client = server.available();
  if (client) {
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        if(index<BUFSIZ)  //Only add data if the buffer isn't full.
        {
          clientline[index]=c;
          index++;
        }
        if (c == '\n' && currentLineIsBlank)
        {
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();
          client.println("<h1><center>LED Control</h1></center>
<center><form method=get action=/?><input type=radio name=L1 value=1>On
<input type=radio name=L1 value=0>Off
<input type=submit value=submit></form></center>");
          break;
        }
        if (c == '\n') {
          currentLineIsBlank = true;
        } 
        else if (c != '\r') {
          currentLineIsBlank = false;
        }
        if(strstr(clientline,"/?L1=1")!=0) {  //look for the command to turn the led on
          digitalWrite(LED, 1);  //turn the led on
        } else if(strstr(clientline,"/?L1=0")!=0) {  //look for command to turn led off. Note: If led is on, it will stay on until command is given to turn it off, even if multiple computers are on the site
          digitalWrite(LED, 0);  //turn led off
        }
      }
    }
    delay(1);
    client.stop();
  }
}

Is it possible to modify this UIPEthernet.h library's example so i can make my ethernet shield to work as a web client and as a web server at the same time?