clientInfo->msgId = *(reinterpret_cast<U32*>(&msgBuff[0]));
clientInfo->pId = *(reinterpret_cast<U32*>(&msgBuff[4]));
clientInfo->timeout = *(reinterpret_cast<U32*>(&msgBuff[8]));
clientInfo->gracePeriod = *(reinterpret_cast<U32*>(&msgBuff[12]));
Solved i thing when we are doing pointer conversion from one type to other type we should use reinterpret_cast and not static_cast.