| 350 | class Mux(Handler): |
| 351 | |
| 352 | def __init__(self, rfile, wfile): |
| 353 | Handler.__init__(self, [rfile, wfile]) |
| 354 | self.rfile = rfile |
| 355 | self.wfile = wfile |
| 356 | self.new_channel = self.got_dns_req = self.got_routes = None |
| 357 | self.got_udp_open = self.got_udp_data = self.got_udp_close = None |
| 358 | self.got_host_req = self.got_host_list = None |
| 359 | self.channels = {} |
| 360 | self.chani = 0 |
| 361 | self.want = 0 |
| 362 | self.inbuf = b('') |
| 363 | self.outbuf = [] |
| 364 | self.fullness = 0 |
| 365 | self.too_full = False |
| 366 | self.send(0, CMD_PING, b('chicken')) |
| 367 | |
| 368 | def next_channel(self): |
| 369 | # channel 0 is special, so we never allocate it |