http://qs321.pair.com?node_id=499082

kampret77 has asked for the wisdom of the Perl Monks concerning the following question:

I have one telnet server address with 2 port. host, portA, portB. i try to make telnet connection using telnet app in linux to the two different port and I can log in (asked the password and user, and get the prompt) The problem is when trying to connect to telnet server portB (10012), i can't get the login and password. It look can open the connection but It fails when trying to log in the code

$telnetSoc->open(); #passed open $telnetSoc->login($user,$pass); #always stop here

*this piece of code wants to show the sequence :D not intended to give full completely code :D i can assume no miss type code syntax* I have try to dump the message and this is the dump message this is error message for host with portA using telnet module

< 0x00000: ff fd 18 ÿý. > 0x00000: ff fc 18 ÿü. < 0x00000: ff fe 18 ff fb 01 ff fb 03 ff fc 21 ff fd 01 0d ÿþ.ÿû.ÿ +û.ÿü!ÿý.. < 0x00010: 0a 0d 0a 20 54 65 6c 6e 65 74 20 63 6f 6e 6e 65 ... Tel +net conne < 0x00020: 63 74 20 74 6f 20 43 4f 4e 53 4f 4c 45 53 45 52 ct to C +ONSOLESER < 0x00030: 56 45 52 20 39 30 30 30 20 73 65 72 69 61 6c 2d VER 900 +0 serial- < 0x00040: 34 34 20 0a 0d 00 0d 0a 0d 00 44 .... +... > 0x00000: ff fd 01 ff fd 03 ff fc 01 ÿý.ÿý.ÿ +ü. < 0x00000: ff fe 01 ÿþ. < 0x00000: 0d 0d 0a 50 65 72 6c 65 20 43 4f 4e 53 4f 4c 45 ...Perl +e CONSOLE < 0x00010: 53 45 52 56 45 52 20 39 30 30 30 20 SERVER +9000 < 0x00000: 0d 0d 0a 56 65 72 73 69 6f 6e 20 33 2e 32 2e 30 ...Vers +ion 3.2.0 < 0x00010: 2e 47 0d 0d 0a .G... < 0x00000: 0d 0a 6c 6f 67 69 6e 3a 20 ..login +:

this is error message for host with portB using telnet module

< 0x00000: 53 65 6c 65 63 74 65 64 20 68 75 6e 74 20 67 72 Selecte +d hunt gr < 0x00010: 6f 75 70 20 62 75 73 79 0d 0a oup bus +y..

Edit: g0n - replaced pre tags with code tags

Replies are listed 'Best First'.
Re: Can't connect to telnet server problems
by theorbtwo (Prior) on Oct 11, 2005 at 11:45 UTC

    Given the dumps you've provided us with, it appears that the problem isn't with your code, but with the server you are connecting to. Have you tried connecting to the server, on both ports, using the normal client?

    In general, when you are given an error message, you should assume the error message is actually correct until you have proven otherwise very well. Perhaps the selected hunt group really is busy?


    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

      First time i thought that something wrong with the server. But maybe i am not clear when explaining the problem upstair.

      I have tried to connect the two different ports using telnet (debian distro) and i can log in using both port (portA and portB).

      But when trying to use perl module i can't connect to the server in one of the port (portB = 10012).

      So i try to use different way, i use phyton and write a small code, and it looks working, i get the login and password prompt when trying connecting to portB (10012).

      btw thx for replaying, i am still searching for the possibility and server mailfunction maybe also one of the posibities (thx for advice) . And i open for any suggestion, maybe another debug method to try etc, etc .

      sincerely yours.

      kampret77