I would put the SendData command in the Winsock_Connect event. If you send the data before Winsock connects, you'll get an error.