示例#1
0
文件: tab.py 项目: UCSD-PL/cbrowser
    def test_loop(self):
        while True:
            #Types, hah
            next_url = random.randrange(len(urls))
            next_url = domain + urls[next_url]

            m = msg.create_req_uri_follow(next_url)
            tlog("Writing message: %s" % str(m))
            msg.write_message_soc(m, self.soc)

            m = msg.read_message_soc(self.soc)
            tlog("Received message: %s" % str(m))
            #tlog(m.content)

            time.sleep(5)

            if (random.randrange(10) == 0):
                m = msg.create_display_shm(self.shm_obj.shmid, 0)
                tlog("display_shm(%d, %d)" % (self.shm_obj.shmid, 0))
                tlog("Writing message: %s" % str(m))
                msg.write_message_soc(m, self.soc)

            c = Cookie.SimpleCookie()
            c.load("Set-Cookie: Foo=Bar; Domain=" + domain +
                   "; Path=/; HttpOnly")
            m = msg.create_set_cookie(c)
            tlog("Writing message: %s" % str(m))
            msg.write_message_soc(m, self.soc)

            time.sleep(5)
示例#2
0
文件: tab.py 项目: raoariel/quark
 def read_message(self):        
     #tlog("BEGIN]read_message is called")
     #stime = time.time()
     m = msg.read_message_soc(self.soc)
     #tlog("<< " + str(m))
     #tlog("END]read_message is finished:%f" % (time.time() - stime))
     return m
示例#3
0
文件: cookie.py 项目: raoariel/quark
 def read_message(self):
     m = msg.read_message_soc(self.soc)
     #clog("<<" + str(m))
     return m
示例#4
0
文件: output.py 项目: raoariel/quark
 def read_message(self):
     #olog("O: read_message is read")
     m = msg.read_message_soc(self.soc)
     #olog("<< " + str(m))
     return m
示例#5
0
def test_loop(soc):
    while True:
        m = msg.read_message_soc(soc)
        olog("Received message: %s" % str(m))