Linux??C????socket?????????
???????????? ???????[ 2014/7/2 14:29:26 ] ??????????????? ??????
/* ?????????????????????????????????????? */
bzero(&s_add??sizeof(struct sockaddr_in));
s_add.sin_family=AF_INET;
s_add.sin_addr.s_addr=htonl(INADDR_ANY); /* ??????????0???????? */
s_add.sin_port=htons(portnum);
/* ???bind???а???? */
if(-1 == bind(sfp??(struct sockaddr *)(&s_add)?? sizeof(struct sockaddr)))
{
printf("bind fail !
");
return -1;
}
printf("bind ok !
");
/* ?????????????? */
if(-1 == listen(sfp??5))
{
printf("listen fail !
");
return -1;
}
printf("listen ok
");
while(1)
{
sin_size = sizeof(struct sockaddr_in);
/* accept???????ú???????????????????????????????????????????п??????????????????????????
??????????????????п???????????????????????????Σ????????????????????????
???accept????????????????????????????????
*/
nfp = accept(sfp?? (struct sockaddr *)(&c_add)?? &sin_size);
if(-1 == nfp)
{
printf("accept fail !
");
return -1;
}
printf("accept ok!
Server start get connect from %#x : %#x
"??ntohl(c_add.sin_addr.s_addr)??ntohs(c_add.sin_port));
/* ???????write???????????????????????????????????? */
if(-1 == write(nfp??"hello??welcome to my server
"??32))
{
printf("write fail!
");
return -1;
}
printf("write ok!
");
close(nfp);
}
close(sfp);
return 0;
}
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Linux??????DDR????????????Linux?????????????????豸??????????linux???в???????????м??????????????????????????Linux????Linux??DNS????????????γ???????????Linux?????????????Linux????(???)????????Linux ????????????????????????????????Windows???У?Linux???????Linux????????????????Linux iommu??vfio???????Linux????ε???TCP???????Linux?????????????СLinux?·???????????Linux???Jexus?й?Asp.Net Core??ó???Linux?????????Щ??
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????