全文预览

C语言-c语言SOCKET编程指南

上传者:hnxzy51 |  格式:pdf  |  页数:63 |  大小:9020KB

文档介绍
9:P;+<=>?@A1Bp2(\r ?PPCDEF+<=>?@A1Gp2(\r ?PPCDEFPHI.JK*`pLAaccept\rPMNO\rstruct sockaddr_in ServerSocketAddr;\rint addrlen;\raddrlen=sizeof(ServerSocketAddr);\rServerSocket=accept(ListenSocket,(struct sockaddr\r*)&ServerSocketAddr,&addrlen);\rPQconnect0(\rint connect(\rSOCKET s,.\rconst struct sockaddr FAR *name,\rint namelen\r)+\r??STLAconnect0(U??Socket s786nameV34\rPWXYPZ4[\]P^_Socket`a.\rconnect 0+,-b SOCKET_ERROR.JK*`p\rMNO\rstruct sockaddr_in daddr;\rmemset((void *)&daddr,0,sizeof(daddr));\rdaddr.sin_family=AF_INET;\rdaddr.sin_port=htons(8888);\rdaddr. sin_addr.s_addr=inet_addr(" 133.197.22.4");\rconnect(ClientSocket,(struct sockaddr *)&daddr,sizeof(daddr))+\r

收藏

分享

举报
下载此文档