void TaskE(void *pdata)
{
uint8 Temp=0;
uint16 TempLength;
int addrlen;
int ei;
unsigned char ip_add[4]={169,254,160,218};
uint8 tempdata[400];
//uint8 err;
SOCKET s;
struct sockaddr servaddr,cliaddr;
Arp_Request(ip_add,0);
OSTimeDly(60);
servaddr.sin_family=0;
servaddr.sin_addr[0]=NetPort[0].My_Ip[0];
servaddr.sin_addr[1]=NetPort[0].My_Ip[1];
servaddr.sin_addr[2]=NetPort[0].My_Ip[2];
servaddr.sin_addr[3]=NetPort[0].My_Ip[3];
servaddr.sin_port=80;
s=*socket( 0, 0, 0);
ei=bind( (SOCKET * )&s, (struct sockaddr*)&servaddr,sizeof(servaddr));
ei=listen( (SOCKET * )&s, 4 );
if(ei!=4)
while(1);
while (1)
{
Temp=accept( (SOCKET * )&s, (struct sockaddr*)&cliaddr,&addrlen );
if(Temp!=0xff)
{
TempLength=recv( Temp,tempdata ,400, 0 );
if(tempdata[5]==' ')
{
send( Temp,httpweb ,169, 0 );
OSTimeDly(10);
send( Temp,web ,395, 0 );
}
else if(tempdata[5]=='1')
{
send( Temp, httpgif,169, 0 );
OSTimeDly(10);
send( Temp,bmp ,442, 0 );
}
memset(tempdata, 0,400);
OSTimeDly(20);
close(Temp);
}
}
请问:tempdata[5]的值怎么来的?pc机只给服务器发了HTTP地址,tempdata收到的是什么啊?小弟初学,菜鸟,望大侠指教。
} |