You're going to have to come up with some form of protocol for your socket connections. How do the two communicate with each other? I find myself in your situation often when I write client/server...