Apparently I forgot how to do Telnet connections
travis
Junior Member
This works from the windows Telnet client, but I can't get it to work from AMX. I need to connect to this telnet server, and type anything + CR, LF.
I put these commands in some channel events and triggered the channel events:
IP_CLIENT_OPEN( dvPC1.Port, ip_PC1, port_PC1, IP_UDP );
Diagnostics output:
Line 10 (17:18:44):: CIpEvent::OnLine 0:6:1
SEND_STRING dvPC1, "'go',13,10"
Notifications output:
Line 15 (17:20:29):: String To [0:6:1]-[go$0D$0A]
The telnet server doesn't react to the string.
IP_CLIENT_CLOSE(dvPC1.PORT)
Diagnostics output:
Line 7 (17:18:14):: CIpEvent::OffLine 0:6:1
What am I forgetting?
I put these commands in some channel events and triggered the channel events:
IP_CLIENT_OPEN( dvPC1.Port, ip_PC1, port_PC1, IP_UDP );
Diagnostics output:
Line 10 (17:18:44):: CIpEvent::OnLine 0:6:1
SEND_STRING dvPC1, "'go',13,10"
Notifications output:
Line 15 (17:20:29):: String To [0:6:1]-[go$0D$0A]
The telnet server doesn't react to the string.
IP_CLIENT_CLOSE(dvPC1.PORT)
Diagnostics output:
Line 7 (17:18:14):: CIpEvent::OffLine 0:6:1
What am I forgetting?
Comments
-
From what I believe telnet is TCP based. Try:
IP_CLIENT_OPEN( dvPC1.Port, ip_PC1, port_PC1, IP_TCP )
-
Doh!
I haven't tried that yet, but I bet that's it. Thanks!
Edit: Yes. that was it. Pay attention when you copy/paste code from other sections... -
We had a thread about this about two years ago. Different Telnet servers may require different negotiation dialogs before they fully accept a connection and the connection can be used. There is a technote about telnet connections, but I think that it's wrong in stating that most telnet servers will accept connections without negotiation.
Anyway, by watching traffic between a working server and client, it was possible to figure out how to work telnet. If you look at this thread http://www.amxforums.com/showthread.php?t=2702&highlight=telnet+ethereal" you'll understand what I'm talking about. In that thread there is a post by user Bob which has a data_event string handler which works for some telnet servers. There is also a sample string handler that I posted which works with a Windows XP Professional telnet server. Get yourself Wireshark (what ethereal is now called) and watch the communications if you have a different server. -
I saw that thread a while ago. It saved me a lot of work on a Windows and a Linux server.We had a thread about this about two years ago. Different Telnet servers may require different negotiation dialogs before they fully accept a connection and the connection can be used. There is a technote about telnet connections, but I think that it's wrong in stating that most telnet servers will accept connections without negotiation.
Anyway, by watching traffic between a working server and client, it was possible to figure out how to work telnet. If you look at this thread http://www.amxforums.com/showthread.php?t=2702&highlight=telnet+ethereal" you'll understand what I'm talking about. In that thread there is a post by user Bob which has a data_event string handler which works for some telnet servers. There is also a sample string handler that I posted which works with a Windows XP Professional telnet server. Get yourself Wireshark (what ethereal is now called) and watch the communications if you have a different server.
This one is working now. Just needed to use TCP instead of UDP. -
You can see here at that page the code for telnet to a windows, linux and apple box: http://www.amxforums.com/showthread.php?t=2702&page=2
Have fun!
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums