文件名称:C++网络数据发送与接收
文件大小:22KB
文件格式:TXT
更新时间:2013-01-10 03:48:13
网络编程
用C++实现网络数据传送,TXT格式。 sockaddr_in clientService; clientService.sin_family = AF_INET; clientService.sin_addr.s_addr = inet_addr( "127.0.0.1" ); clientService.sin_port = htons( 8000 ); if ( connect( client, (SOCKADDR*) &clientService, sizeof(clientService) ) == SOCKET_ERROR) { printf( "Failed to connect.\n" ); WSACleanup(); return; }