xmllmx - Don't call recv() to check if the socket has closed, use select() and ask it to signal when the socket is readable or writable. Note also that unless you're just writing a demo for class you most likely want to set your sockets to non-blocking mode anyway as calling recv() with too big of a buffer will cause it to block, so will causing send() with a buffer that can't fit into the OS's buffer, etc...
Finally, using select() is pretty terrible in Winsock as well; you probably want to use one of the forms of Overlapped I/O, such as completion routines or completion ports.