??Linux?????????TCP??keepalive????
???????????? ???????[ 2014/5/16 15:23:13 ] ??????????????
???????????????????????
??????????????????????佨?????????socket??·?????????????
???????????????????????????????????socket?????????????????????????socket??????????????????????io?????б??У????????£?
int listenfd;
struct sockaddr_in server_sin;
/* establish socket */
listenfd=socket(AF_INET??SOCK_STREAM??0);
server_sin.sin_family=AF_INET;
server_sin.sin_addr.s_addr=htonl(INADDR_ANY);
server_sin.sin_port=htons(PORT);
bind(listenfd??(struct sockaddr *)&server_sin??sizeof(server_sin));
/* establish end */
listen(listenfd??1024);
qemu_set_fd_handler2(listenfd?? NULL?? tcpkeepalive_server?? NULL??
(void *)(intptr_t)listenfd);
??????socket??????????????£?
static void tcpkeepalive_server(void *opaque)
{
int connfd;
struct sockaddr_in client_sin;
socklen_t client_len=sizeof(client_sin);
int listenfd = (intptr_t)opaque;
connfd=accept(listenfd??(struct sockaddr *)&client_sin??&client_len);
}
????????????????儷????????????????socket?????????????????????????tcpkeepalive?????????socket????????????????io?????б??
?????????????socket?????????????????·??????????????????????????????????????????????????????????????tcpkeepalive???????????????????????????????????????????????????????????????????????????С?
??????????????£?
int sockfd;
struct sockaddr_in sin;
int optval;
socklen_t optlen = sizeof(optval);
sockfd=socket(AF_INET??SOCK_STREAM??0);
sin.sin_family=AF_INET;
sin.sin_addr.s_addr=addr.sin_addr.s_addr;
sin.sin_port=htons(PORT);
optval = 1;
setsockopt(sockfd?? SOL_SOCKET?? SO_KEEPALIVE?? &optval?? optlen);
optval = 5;
setsockopt(sockfd?? SOL_TCP?? TCP_KEEPCNT?? &optval?? optlen);
optval = 1;
setsockopt(sockfd?? SOL_TCP?? TCP_KEEPIDLE?? &optval?? optlen);
optval = 1;
setsockopt(sockfd?? SOL_TCP?? TCP_KEEPINTVL?? &optval?? optlen);
connect(sockfd??(struct sockaddr *)&sin??sizeof(sin));
qemu_set_fd_handler2(sockfd?? NULL?? tcpkeepalive_vm_start?? NULL??
(void *)(intptr_t)sockfd);
??????socket??????????????????????????????У?
????static void tcpkeepalive_vm_start(void *opaque)
????{
????vm_start();
????}
???????????????????????漰???????????????????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 ??????