c±à³Ì ͨѶÐÒéhttp
Îʸö±È½ÏÈõµÄÎÊÌâ¡£
ÓÃc¿ª·¢£¬·þÎñÆ÷ºÍ¿Í»§¶ËµÄ³ÌÐò£¬Í¨Ñ¶ÐÒéÓÃhttp¡£
²»ÖªµÀÔõôÈëÊÖÁË£¬ÊDz»ÊÇsocket±à³Ì£¿»¹ÊÇÓ¦¸Ã¿´ÄÄЩ·½ÃæµÄ¼¼Êõ
ÓÐÏֳɵÄhttp¿â ÄÃÀ´ÓÃ
×Ô¼ºÐ´socketÂé·³ËÀÁË
ÍøÉÏÕÒµã´úÂ룡 ×Ô¼ºÐ´ÄÜ·³ËÀ£¡
ллÁË
ÏÖÔÚÓÐÄÄЩhttp¿â£¬±È½Ï³£Óõģ¿
¶¥Ò»Ï£¡
C/C++ code:
#include<iostream>
#include<map>
#include<stdlib.h>
#include<signal.h>
#include<errno.h>
#include<unistd.h>
#include<string.h>
#include<sys/resource.h>
#include<sys/stat.h>
#include<sys/types.h>
#include<fcntl.h>
#include<netinet/in.h>
#include<arpa/inet.h>
#include<sys/socket.h>
#define PORT 80
#define BUFSIZE 8196
#define LISTENQ 64 //
using namespace std;
struct client_t{
int fd;
int state;
unsigned int pois;
string ip;
string read_buf;
string write_buf;
//http request
string method_req;
string url;
string http_v;
string host;
client_t(){
fd=0;
state=0;//¶Áд״̬£¬0-¶Á£¬1-д
pois=0;
ip.clear();
read_buf.reserve(BUFSIZE);
write_buf.reserve(BUFSIZE);
method_req.clear();
Ïà¹ØÎÊ´ð£º
ÔÚueÖдÓÔ¶³ÌunixÓöþ½øÖÆ·½Ê½ÏÂÔØcÎļþµ½±¾µØ£¬ÐÞ¸ÄÖ®ºóÓöþ½øÖÆ·½Ê½ÉÏ´«µ½unixÖУ¬ÔÙÓÃvi´ò¿ª¸ÃÎļþ£¬Ã¿ÐкóÃæ¾Í»áÓÐÒ»¸ö^MµÄ»»Ðзû£¬Èç¹û²ÉÓÃascii·½Ê½ÏÂÔØ£¬¶þ½øÖÆ·½Ê½ÉÏ´«µÄ»°¾ÍûÓÐ^M£¬ÄÇÇëÎÊÕâÑù»á¶Ô³ÌÐòÎļþ ......
QQȺ 29152388
ÓÑÇéUP
°ï¶¥
up
°ïup
up Ö§³Ö£¡
up jf
...ÄѵÀÓзÖ..?
up up up
Ï£ÍûÓеüӷ֣¬¹þ¹þ¡£
Ö§³Ö£¬ÎÒ¼ÓÁË£¬Ï£ÍûÂ¥Ö÷ÄܼÓÎÒ£¬¹²Í¬Ñ§Ï°¹þ
¼ÓÁË¡£
¶¥ÉÏ£¬Ã¿ÌìÊÕ»ñÒ»µã£¬Ö§³Ö ......
ÎÊһϣº
#include <stdio.h>
int main()
{
char x, y, z;
int i;
int a[16];
for(i=0; i<=16; i++)
{
a[i] = 0;
......
ÎÒÊäÈë1 µ«Êä³ö²»ÊÇ1 ÎÊÒ»ÏÂÎÒÄÄ´íÁË?Ö÷ÒªÊDzÎÊýµÄ´«µÝ³ö´íÁ衃 µ«ÎÒÔõôҲ¿´²»³öÀ´ ÎÒµÄÊǵØÖ·´«µÝ
#include "stdio.h"
typedef int type;
typedef struct lnode
{
type elem;
stru ......
CΪʲôûÓб»C++´úÌæ,CÄÜ×öµÄC++¶¼ÄÜ×ö°É£¿C++ÄÜ×öµÄC²»Ò»¶¨ÄÜÄÜ×ö°É£¿ÄÇΪʲôC»¹Ã»Óб»ÌÔÌÄØ£¿
×îÊÊÓõÄÁìÓò²»Í¬ËùÒÔÄÜÕ¾µÃסßÂ~~~
Â¥Ö÷˵´íÁË£¬C++ÄÜ×öµÄCÈ«ÄÜ×ö£¬ÒòΪC++Ò²ÊÇCʵÏֵġ£
ÓÐÐí¶àµØ·½Ó ......