2

Author Topic: Can you establish two telnet connections in one script (so I can use two APIs)?  (Read 2449 times)

0 Members and 1 Guest are viewing this topic.

Offline SciTech02Topic starter

  • Robot Overlord
  • ****
  • Posts: 136
  • Helpful? 3
  • Life's but a green duck with soy sauce. -MegaHAL
This may be a stupid or overly obvious question, but here it goes:

Various programs have features I would like to use in my scripts.  These features can be accessed through built in API functions.  These API functions are made possible by establishing a telnet connection to that program. 

Alright, here's my question.  There are two programs that make use of API functions that I wish to use in a script at the same time.  To do this, I have to establish two different telnet connections in the same script.  Is this possible, or can I only establish one telnet connection at a time (or, in other words, only use one of these APIs at a time)?

Thanks in advance.
Check out the Evolution Robotics, ER1 robot, and ERSP Resource Page: http://www.societyofrobots.com/member_tutorials/node/336

Offline kevinisnekkid

  • Jr. Member
  • **
  • Posts: 30
  • Helpful? 0
Need more info... can you give an example of what you mean? But you probably can do it...
Robots don't hide what they are.

Offline SciTech02Topic starter

  • Robot Overlord
  • ****
  • Posts: 136
  • Helpful? 3
  • Life's but a green duck with soy sauce. -MegaHAL
Well, the host of this type of telnet connection is 'localhost' (the same computer with the programs I want to connect to).  The address of program A is 9000 and the address of program B is 6060.  What I was asking is if you could establish two of these connections at the same time.  Here's a crude pseudo code of what I want to do:

//establish connections:
telnet(localhost - to - 9000)
telnet(localhost - to - 6060)
//Now you can send (API) commands across both these connections to each program, when specified.

Yes, this should be possible; actually seems obviously simple now...  ::)  I would have tried this out first before posting a question, but my robot is packed away temporally, so I can't do anything with it.

If this topic was spam, I apologise (still learning/getting used to/perfecting my programing skills).
Check out the Evolution Robotics, ER1 robot, and ERSP Resource Page: http://www.societyofrobots.com/member_tutorials/node/336

Offline jamort

  • Supreme Robot
  • *****
  • Posts: 375
  • Helpful? 2
you could make a command open new prompt then have telnet after the one on the one prompt and another connection on the other prompt
my english teacher once said, "dont talk about what you dont know in public...."

so I replied the truth, " Exactly why I dont ever talk about English."

Offline CrashOverron

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
yeah you can connect both at the same time you will get a socket id for each so set them as different variables and just use those

 


Get Your Ad Here

data_list