Multiple concurrent telnet sessions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tony Pryor

    #1

    Multiple concurrent telnet sessions

    Hello,

    Anyone know if running two client telnet sessions at the same time
    should be an inherent problem? They don't seem to want to share a port
    or are they trying to use the same console for interaction with the
    connected servers?

    -Tony

    Hello from parent loop 1 ipaddress1
    Hello from parent loop 2 ipaddress2
    Hello from thread 1
    Hello from thread 2
    Unhandled exception in thread started by <bound method Telnet.listener
    of <telnetlib.Teln et instance at 0xf6f8ea6c>>
    Unhandled exception in thread started by <bound method Telnet.listener
    of <telnetlib.Teln et instance at 0xf6f8eacc>>
    Traceback (most recent call last):
    File "telmt.py", line 34, in ?
    time.sleep(60)


    import thread, sys, time, telnetlib

    def child(tid,ip):
    print 'Hello from thread', tid
    tn = telnetlib.Telne t()
    tn.mt_interact( )
    tn.open(ip, 10001)
    def clear(tn):
    tn.write("AT")
    tn.expect("OK")
    tn.write("ATMC" )
    tn.expect("OK")
    tn.expect("ATUC L")
    tn.expect("OK")
    clear(tn)
    time.sleep(1)
    tn.write("ATDI, 15,00000000")
    (unparsed, ack) = expect("DONE")
    print unparsed
    time.sleep(1)
    clear(tn)

    def parent(iplist):
    i = 0
    for ip in iplist:
    i = i+1
    tuple = (i, ip,)
    thread.start_ne w_thread(child, tuple)
    print 'Hello from parent loop', i, ' ', ip

    iplist = ["ip.ad.dr.1 ", "ip.ad.dr.2 "]
    parent(iplist)
    time.sleep(60)
  • Lee Harr

    #2
    Re: Multiple concurrent telnet sessions

    On 2004-12-08, Tony Pryor <dpplgngr@gmail .com> wrote:[color=blue]
    > Hello,
    >
    > Anyone know if running two client telnet sessions at the same time
    > should be an inherent problem? They don't seem to want to share a port
    > or are they trying to use the same console for interaction with the
    > connected servers?
    >[/color]

    I don't know if it will work, but have you looked at using
    twisted for networking? If nothing else, someone on the
    twisted mailing list may be able to point you in the right
    direction...


    Comment

    Working...