By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,623 Members | 1,968 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,623 IT Pros & Developers. It's quick & easy.

Multiple concurrent telnet sessions

P: n/a
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.Telnet instance at 0xf6f8ea6c>>
Unhandled exception in thread started by <bound method Telnet.listener
of <telnetlib.Telnet 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.Telnet()
tn.mt_interact()
tn.open(ip, 10001)
def clear(tn):
tn.write("AT")
tn.expect("OK")
tn.write("ATMC")
tn.expect("OK")
tn.expect("ATUCL")
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_new_thread(child, tuple)
print 'Hello from parent loop', i, ' ', ip

iplist = ["ip.ad.dr.1", "ip.ad.dr.2"]
parent(iplist)
time.sleep(60)
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 2004-12-08, Tony Pryor <dp******@gmail.com> wrote:
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?


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...

http://twistedmatrix.com/
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.