If you don't understand an error message, Google it:
10014 socket error - Google Search[
^]
The top link explains what the error means:
Windows Sockets Error Codes (Windows)[
^]
Quote:
WSAEFAULT
10014
Bad address.
The system detected an invalid pointer address in attempting to use a pointer argument of a call. This error occurs if an application passes an invalid pointer value, or if the length of the buffer is too small. For instance, if the length of an argument, which is a sockaddr structure, is smaller than the sizeof(sockaddr).
So now you know what the error message means, start using the debugger to look at you code while it runs, to find out which pointer is giving the problem, and what it is pointing at.
We cannot do that for you: we do not have any access to your system while your code is running!