• <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,再見(jiàn)!高德

            https://github.com/adoggie

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

            常用鏈接

            留言簿(54)

            我參與的團(tuán)隊(duì)

            搜索

            •  

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

             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 放屁阿狗 閱讀(650) 評(píng)論(-2)  編輯 收藏 引用 所屬分類(lèi): perl/python/php/lua/tcl
            国产亚州精品女人久久久久久 | 久久亚洲精品国产精品婷婷| 国产精品一区二区久久精品无码 | 欧美粉嫩小泬久久久久久久| 午夜天堂av天堂久久久| 中文字幕成人精品久久不卡| 无码人妻久久一区二区三区蜜桃| 色欲av伊人久久大香线蕉影院| 99久久精品国产一区二区三区| 久久精品国产2020| 国产成人99久久亚洲综合精品| 囯产极品美女高潮无套久久久| 亚洲国产精品久久久久婷婷老年 | 97热久久免费频精品99| 午夜精品久久久久成人| 久久美女人爽女人爽| 精品久久久无码21p发布| 国产91久久综合| 国内精品久久久久| 热re99久久6国产精品免费| 久久只这里是精品66| 999久久久免费国产精品播放| 久久精品国产亚洲AV高清热 | 国产亚洲欧美精品久久久| 午夜精品久久久久久影视riav| 亚洲狠狠综合久久| 精品久久无码中文字幕| 久久香蕉超碰97国产精品| 一本久久综合亚洲鲁鲁五月天| 九九久久精品无码专区| 国产国产成人久久精品| 2020最新久久久视精品爱| 久久电影网一区| 一本久久久久久久| 国产成人精品久久亚洲高清不卡 国产成人精品久久亚洲高清不卡 国产成人精品久久亚洲 | 国内精品九九久久久精品| 久久久国产精品亚洲一区| 999久久久免费精品国产| 国产精品久久一区二区三区| 久久精品国产免费一区| 国产精品免费久久久久久久久|