基于Linux的socket编程模板(8)
来源:未知 责任编辑:责任编辑 发表时间:2014-01-20 07:53 点击:次
{
continue;
}
// check the header
if ( memcmp( sPack.cmdHeader, TCP_CMD_HEADER_STR, TCP_CMD_HEADER_LEN ) != 0 )
{
rPack.returnCMD = DVS_RETURN_INVLID_HEADER;
// return error info to client
returnBytes = send(socketfd,(uint8_t *)&rPack,RETURN_PACK_LEN,0 ) ;
if( returnBytes < RETURN_PACK_LEN)
{
printf("send error!\n");
continue;
}
}
// analyse cmd
rPack.returnCMD = DVS_RETURN_SUCCESS;
switch( sPack.serverCMD )
{
case CMD_SAVE_USER_NAME:
{
if( save_user_name(sPack.Parameters.UserName.username) != 0)
{
rPack.returnCMD = DVS_RETURN_FAIL;
}
}
break;
相关新闻>>
- 发表评论
-
- 最新评论 更多>>