void SocketConnect::sendMessage()
{
    CCLOG("SEND THREAD HAS BEGAN !\n");
    SOCKET socket = this->socketSet;
    MessageQueue * queue = MessageQueueManager::getInstance()->getSendQueue();
    while (true)
    {
        if (queue->getQueueSize() > 0)
        {
            CCLOG("SENDQUEUE SIZE IS %d\n",queue->getQueueSize());
            
            queue->queueLck();
            SocketMessage *  msg = queue->frontQueue();
            queue->queueUnlck();
            
            CCLOG("SEND TO SERVER FROM SENDQUEUE : %s, DATA LENGTHT : %d\n",msg->getData().c_str(),msg->dataLength());
        
            if (-1 == send(socket, msg->getData().c_str(), msg->dataLength(), 0)) {
                CCLOG("SEND TO SERVER ERROR ! WILL BE TRY TO SEND AGAGIN !\n");
            }
            else{
                CCLOG("SEND TO SERVER SUCCESS !\n");
                
                queue->queueLck();
                queue->popQueue();
                queue->queueUnlck();
                delete msg;
            }
        }
        else{
           // CCLOG("QUEUE IS EMPTY !");
        }
    }
}