This is my first time doing winsock programmnig. I study the MSDN and I got a hang on Winsock with the example provided which is able to send text. My question is, how can we use the Winsock to send a file to the client or vise versa.

And how do the winsock control in the server knows that the winsock control in the client has terminated the connection ?

thanks.