| 377 | udphandlers = {} |
| 378 | |
| 379 | def udp_req(channel, cmd, data): |
| 380 | debug2('Incoming UDP request channel=%d, cmd=%d' % |
| 381 | (channel, cmd)) |
| 382 | if cmd == ssnet.CMD_UDP_DATA: |
| 383 | (dstip, dstport, data) = data.split(b(','), 2) |
| 384 | dstport = int(dstport) |
| 385 | debug2('is incoming UDP data. %r %d.' % (dstip, dstport)) |
| 386 | h = udphandlers[channel] |
| 387 | h.send((dstip, dstport), data) |
| 388 | elif cmd == ssnet.CMD_UDP_CLOSE: |
| 389 | debug2('is incoming UDP close') |
| 390 | h = udphandlers[channel] |
| 391 | h.ok = False |
| 392 | del mux.channels[channel] |
| 393 | |
| 394 | def udp_open(channel, data): |
| 395 | debug2('Incoming UDP open.') |