Persistant Socket Client and per request Web Server Possible?

I know the W5100 chip has 4 sockets available and I know the Arduino is single threaded... so I'd like to know if there is a way to keep a connection to say a telnet server while also being able to keep a server going at the same time. Obviously both won't be able to work at the exact same time, however, I'd like to be able to keep the telnet client session up while also being able to accept web requests. That way I don't have to create and tear down the telnet session. The W5100 chip has a buffer so anything that comes down the telnet would be available after I'm done with the web request and vice-versa...

Seems possible, however, I'm not able to get it to work... just want to throw this by a few of you...

Had some logic issues, it does work for those keeping score at home!