Apparently I forgot how to do Telnet connections
travis
Posts: 180
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?
0
Comments
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...
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.
Have fun!