• <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
            亚洲а∨天堂久久精品9966| 精品熟女少妇av免费久久| 九九久久自然熟的香蕉图片| 少妇内射兰兰久久| 久久久精品一区二区三区| 伊人久久精品影院| 久久精品国产99国产精偷| 久久精品国产乱子伦| 亚洲一本综合久久| 久久精品国产亚洲av水果派| 日产久久强奸免费的看| 亚洲国产精品久久久天堂| 99久久久久| 久久久久久久亚洲Av无码| 久久精品无码av| 国产真实乱对白精彩久久| 精品精品国产自在久久高清| 久久久精品久久久久影院| 人妻中文久久久久| 国内精品久久国产大陆| 伊人久久精品无码二区麻豆| 午夜欧美精品久久久久久久| 国产精品无码久久综合网| 亚洲国产精品一区二区久久| 中文字幕人妻色偷偷久久| 亚洲AⅤ优女AV综合久久久| 久久精品国产精品亚洲精品| 99久久99这里只有免费费精品 | 久久精品免费观看| 亚洲中文精品久久久久久不卡| 久久久久久久综合日本| 99久久免费国产精品| 国产成人综合久久久久久| 久久久久综合网久久| 婷婷久久综合九色综合98| 国产精品美女久久久久网| 99久久精品国产高清一区二区 | 国产三级久久久精品麻豆三级| 久久综合狠狠综合久久综合88| 久久亚洲精精品中文字幕| 久久人人爽人人爽人人片av高请 |