• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            socketref,再見!高德

            https://github.com/adoggie

              C++博客 :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
              246 Posts :: 4 Stories :: 312 Comments :: 0 Trackbacks

            常用鏈接

            留言簿(54)

            我參與的團隊

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

             1 #################################
             2 # swMap Test 
             3 # scott  
             4 # 2010.11.19
             5 # wallizard.vicp.net sw2us.com
             6 #################################
             7 #simplest http server 
             8 # expose image 
             9 #
            10 
            11 import BaseHTTPServer,SocketServer,SimpleHTTPServer 
            12 import time,sys,os,os.path
            13   
            14 
            15 class MyThreadServer(SocketServer.ThreadingMixIn, BaseHTTPServer.HTTPServer): pass
            16 
            17 '''
            18 HTTP/1.1 200 OK
            19 Cache-Control: private, max-age=30
            20 Content-Type: text/html; charset=utf-8
            21 Content-Encoding: gzip
            22 Expires: Mon, 25 May 2009 03:20:33 GMT
            23 Last-Modified: Mon, 25 May 2009 03:20:03 GMT
            24 Vary: Accept-Encoding
            25 Server: Microsoft-IIS/7.0
            26 X-AspNet-Version: 2.0.50727
            27 X-Powered-By: ASP.NET
            28 Date: Mon, 25 May 2009 03:20:02 GMT
            29 Content-Length: 12173
            30 '''
            31 '''
            32 Pragma:no-cache
            33 Cache-Control:no-cache
            34 '''
            35 
            36 class MyHander(SimpleHTTPServer.SimpleHTTPRequestHandler):
            37     def __init__(self,request, client_address, server):
            38         SimpleHTTPServer.SimpleHTTPRequestHandler.__init__(self,request, client_address, server)
            39     
            40     def do_GET(self):
            41         print self.headers         
            42         
            43         f= open('d:/nono.gif','rb')
            44         image  = f.read()
            45         f.close()
            46         
            47         self.send_response(200)
            48         self.send_header( 'Server','swMapServer')
            49         now = self.date_time_string(time.time())        
            50         self.send_header('Date',now)
            51         self.send_header('Content-Type','image/gif')
            52         self.send_header('Content-Length',len(image))
            53         self.end_headers()
            54         
            55         self.wfile.write(image)
            56 
            57 def run(server_class=MyThreadServer,handler_class=MyHander):
            58     server_address = (''8000)
            59     httpd = server_class(server_address, handler_class)
            60     print 'serve on ',server_address
            61     httpd.serve_forever()
            62 
            63     
            64 run()

            posted on 2010-11-19 09:57 放屁阿狗 閱讀(642) 評論(-2)  編輯 收藏 引用 所屬分類: perl/python/php/lua/tcl
            精品久久亚洲中文无码| 久久亚洲国产欧洲精品一| 国产成人综合久久精品红| 色偷偷偷久久伊人大杳蕉| 久久综合综合久久狠狠狠97色88| 久久亚洲2019中文字幕| 久久久久人妻一区二区三区vr| 久久精品无码一区二区三区日韩 | 久久久久av无码免费网| 久久婷婷国产麻豆91天堂| 亚洲AV无码久久精品成人| 久久久久无码中| 久久亚洲高清观看| 精品国产乱码久久久久久1区2区 | 国产69精品久久久久观看软件| 国产精品99久久免费观看| 亚洲精品无码久久久久久| 亚洲国产精品无码久久青草| 国产99久久九九精品无码| 久久精品亚洲精品国产色婷 | 久久青青国产| 国内精品久久久久久不卡影院| 国产亚洲婷婷香蕉久久精品| 久久久一本精品99久久精品66| 久久无码AV中文出轨人妻| 久久天天日天天操综合伊人av| 久久久久中文字幕| 精品久久777| 91精品国产综合久久香蕉| 97久久国产亚洲精品超碰热| 久久久久久国产精品无码超碰| 99久久夜色精品国产网站 | 久久精品免费一区二区三区| 国产精品禁18久久久夂久| 久久九九有精品国产23百花影院| 久久99精品久久久久久久不卡| 国产精品久久久久天天影视| 久久精品一区二区三区不卡| 91精品国产色综久久| 久久九九免费高清视频| 狠狠色噜噜色狠狠狠综合久久|