首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

http服务器端工作流程

root@ubuntu:/home/hfl/hflsamb/network# ./http_test_server  -p 8000  http_test_server: port 8000,  cpu affinity CPU0, content directory /home/hfl/hflsamb/network, rate 19.400000, loop around 0, send_from_memory 0, verbose 0, disable TCP checksum 0 Allocated 4141032-bytes for buffering, # of DESC=24 Accepted Connection from 801ca8c0:51541  Read HTTP Req ( 125 bytes)[ GET //love.mp3 HTTP/1.1 Host: 192.168.28.128:8000 Rate: 19 PlaySpeed.dlna.org: speed=1 User-Agent: STDSOCKET Test App ] TokenFound = [/love.mp3] Stream file = /home/hfl/hflsamb/network//love.mp3 size=577760125939925376 HTTP Response [ HTTP/1.1 200 OK Content-Length: 2464551019266432 Connection: Keep-Alive Accept-Ranges: bytes Connection: close Content-Range: bytes 0--5224570189344358016/1 Server: Linux/2.6.18, UPnP/1.0, my test app ]Content File opened **** Reached EOF *******

02

【Xbox one S】开箱&开机&初入坑心得

身为一个资lao深nian单机游戏玩家,常年混迹在PC平台,但内心深处一直对主机有种迷之向往,感觉那才是单机游戏的正处之地,坐沙发上拿着手柄对着电视跌宕起伏才是正确的游戏姿势。80后的机友大概都有小时候跟小伙伴坐地上双打小霸王的愉快记忆,儿时的记忆总是那么深刻,任凭岁月和社会如何磨灭,总有些感觉想要找回,所以很难说现在淘来一台游戏机有几分是为了当下的娱乐,几分是为了找到当年的感觉。当然了,今天的PC也完全可以让你坐沙发拿手柄看电视甚至玩着相同的游戏,但就凭它叫游戏机,给我的感觉就不同,大概因为电脑这个东西毕竟还是带了一定的工作色彩。至于为什么是Xbox而不是PS,是因为后者手柄丑~索尼大法好,其实就是先挑个听起来相对熟悉点的坑跳吧。

03

http协议户端下载流程

/************************************************************************************** 功能:http协议客户端网络下载测试 时间:2014-03-09 version : V1.0 说明:http协议客户端工作要点 1.创建socketbind本地socket,发起连接connetct ,完成tcp三次握手 2.向服务器发起http请求,即post或get动作,http协议请求格式见   http协议规范  3.读http响应,可以判定http 服务器和客户端是否通讯正常,如果失败,  可以根据错误代码判定不成功原因。  http 响应和http 错误代码见http协议部分  4.http响应会返回内容的长度和内容类型,这个信息在在在线业务中是个  非常有用的信息,比如流媒体是边看边下载,如果要计算流媒体长度  只能从http响应读取。 ***************************************************************************************/ #include <fcntl.h> #include <sys/syscall.h> #include <sys/mman.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> #include <sys/types.h> #include <errno.h> #include <stdlib.h> #define SERVER_PORT 5000 #define BUF_MASK 0x1ff #define BUF_SIZE (188*7*64) #define O_DIRECT 0x8000 void usage() {     printf("Usage: http_test_client: -d <srv-ip> -p <srv-port> -f <content-file> [-h -a -v]\n");     printf("options are:\n");     printf(" -d <srv-ip>   # IP address of HTTP Server (e.g. 192.168.1.110)\n");     printf(" -p <srv-port> # Port of HTTP Server (e.g. 5000)\n");     printf(" -f <file>     # url of stream; /data/videos prepended (e.g. portugal.mpg) \n");     printf(" -m            # just leave content in memory, dont write to disk (default: write to file)\n");     printf(" -v            # print periodic stats (default: no)\n");     printf(" -h            # prints http_test_client usage\n");     printf("\n"); } double difftime1(struct timeval *start, struct timeval *stop) { double dt = 1000000.*(stop->tv_sec - start->tv_sec) + (stop->tv_usec - start->tv_usec); return dt; } /* This function creates a TCP connection to server and returns the socket descriptor */ int TcpConnect(char *server, int port, int socket_type) { int sd,rc; struct sockaddr_in localAddr, servAddr; struct h

02
领券