I don't know why you are changing char buffer to byte and then sending it, I think following code directly works with your const char*. If there is any reason you want to convert into byte, convert at the other end. By changing to below code it should work...
send( mySocket, cmd, (int)strlen(cmd), 0 );