• <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++博客 :: 首頁 :: 聯系 :: 聚合  :: 管理
              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 放屁阿狗 閱讀(632) 評論(-2)  編輯 收藏 引用 所屬分類: perl/python/php/lua/tcl
            国产激情久久久久影院小草| 免费一级欧美大片久久网| 精品一二三区久久aaa片| 午夜福利91久久福利| 亚洲精品NV久久久久久久久久| 午夜肉伦伦影院久久精品免费看国产一区二区三区 | 欧美伊香蕉久久综合类网站| 久久精品中文无码资源站| 99麻豆久久久国产精品免费| 66精品综合久久久久久久| 99久久综合国产精品二区| 久久精品亚洲福利| 伊人久久综合精品无码AV专区| 亚洲AV无码久久精品色欲| 97超级碰碰碰久久久久| 久久久久无码专区亚洲av| 亚洲а∨天堂久久精品| 久久精品国产99久久无毒不卡 | 久久久久亚洲av成人无码电影| 亚洲国产成人精品久久久国产成人一区二区三区综 | 久久精品人人做人人爽电影| 99久久久精品| 日韩亚洲国产综合久久久| 97久久国产亚洲精品超碰热 | 亚洲精品国产字幕久久不卡| 日本久久久精品中文字幕| 亚洲精品成人久久久| 亚洲一区中文字幕久久| 久久久亚洲AV波多野结衣 | 91麻精品国产91久久久久| 亚洲伊人久久综合影院| 久久精品男人影院| 新狼窝色AV性久久久久久| 久久久久人妻精品一区三寸蜜桃| 一本久久知道综合久久| 久久五月精品中文字幕| 久久青青草原综合伊人| 色婷婷久久综合中文久久蜜桃av| 久久久久国色AV免费观看| 久久国产精品久久| 久久精品国产亚洲精品2020|