|
各位大侠,求救功能机的MoDIS socket连接,有谁在MODIS上OK过的?指点一下!
大概程序如下:
soc_init_win32(); //初始化
cbm_register_app_id_with_app_info(&info, &app_id);
acct_id = cbm_set_app_id(CBM_DEFAULT_ACCT_ID, app_id);
socketID = soc_create(SOC_PF_INET, SOC_SOCK_STREAM, 0, MOD_VCM, acct_id); //create,返回socket ID没有问题
if(socketID >=0)
{
if((ret = soc_setsockopt(socketID, SOC_NBIO, &val, sizeof(val))) < 0)
return KAL_FALSE;
val = SOC_READ | SOC_WRITE | SOC_CLOSE | SOC_CONNECT;
if((ret = soc_setsockopt(socketID, SOC_ASYNC, &val, sizeof(val))) < 0)
return KAL_FALSE;
}
else
return KAL_FALSE;
socketAddress.addr[0] = 10;
socketAddress.addr[1] = 0;
socketAddress.addr[2] = 0;
socketAddress.addr[3] = 172;
socketAddress.addr_len = 4;
socketAddress.port = 80;
ret = soc_connect(socketID, &socketAddress); //connect返回值OK,没有问题
construct_http_frame(httpFrame);
ret = soc_send(socketID, (kal_uint8*)httpFrame, 1024, 0); //send返回ret值1024,没有问题
ret_val = soc_recv( socketID, (kal_uint8*) (socReceiveBuffer), 1024, 0); //recv先返回-2,等待notify消息后,得到如下error
HTTP 1.1/504
<img src="attachments/dvbbs/2012-10/2012102311462778051.jpg" border="0" onclick="zoom(this)" onload="if(this.width>document.body.clientWidth*0.5) {this.resized=true;this.width=document.body.clientWidth*0.5;this.style.cursor='pointer';} else {this.onclick=null}" alt="" /> |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
×
|