c 语言 socketERR_CONNECTION_REFUSED
printf('HTTP/1.1 200 OkayrnContent-Type: text/html; charset=ISO-8859-4 rnrn
Hello, client! Welcome to the Virtual Machine Web..'); 这句话的意思是往你的终端打印内容,而不是往客户端的链接中输出内容,改成:char buf[] = 'HTTP/1.1 200 OkayrnContent-Type: text/html; charset=ISO-8859-4 rnrn
Hello, client! Welcome to the Virtual Machine Web..';write(sock, buf, sizeof(buf));
就可以了
赞0
踩0