Welcome to the forums!
We don't bind() a client socket. We let the operating system auto-bind() to an available port when we call connect(). This is for the reason you are experiencing. Only one socket can be bound to a port and subsequent attempts to bind() to the same port will fail. Also, we need to closesocket() our sockets when we are finished with them. Finally, you should not call WSACleanup on every button press. WSAStartup() should be called only once at program startup and WSACleanup() should be called only once when the program is finishing.
We also need to deal with the fact that input from the network may not be null terminated. Therefore, we have to do it explicitly.
This is typically done something like:
I'll leave it up to you to add that to your code.
int ret = recv(s,buf,sizeof(buf) - 1,0);
if (ret != SOCKET_ERROR)
buf[ret] = '\0';
// use buffer safely
So, delete the red code and add the green:
// TODO: Add your control notification handler code here
sockaddr_in a1, a2;
if(bind(s,(LPSOCKADDR) &a1, sizeof(a1))==SOCKET_ERROR)