/* 【程序编程相关:IEEE 802? Groups - P】
【推荐阅读:如何调整dotNet 服务器的性能,具体】 * listing 2: 【扩展信息:解析新一代WLAN安全技术IEEE 80】 * an example client for "hello, world!" server * ivan griffin (ivan.griffin@ul.ie) *//* hellwolf misty translated */
#include <stdio.h> /* perror() */
#include <stdlib.h> /* atoi() */ #include <sys/types.h> #include <sys/socket.h> #include <unistd.h> /* read() */ #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h>int main(int argc, char *argv[])
{ int clientsocket, remoteport, status = 0; struct hostent *hostptr = null; struct sockaddr_in servername = { 0 }; char buffer[256] = ""; char *remotehost = null;if (3 != argc)
{ fprintf(stderr, "usage: %s \n", argv[0]); exit(1); }remotehost = argv[1];
remoteport = atoi(argv[2]);clientsocket = socket(pf_inet, sock_stream,
ipproto_tcp); if (-1 == clientsocket) { ... 下一页