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)
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
def read_message(self): m = msg.read_message_soc(self.soc) #clog("<<" + str(m)) return m
def read_message(self): #olog("O: read_message is read") m = msg.read_message_soc(self.soc) #olog("<< " + str(m)) return m
def test_loop(soc): while True: m = msg.read_message_soc(soc) olog("Received message: %s" % str(m))