It's not exactly clear from your description what the problem is. You also didn't include the client code, which makes debugging harder. If the client is using readline (i.e. <sockethandle>), then the client is going to be waiting a while since you didn't include a newline with the "GOOD" or "BAD" response.