When debugging a network program, a problem occurs. when the service is started, the client cannot connect. First, you can use telnet to connect to the client. the command is the same as that in Windows, telnetIP port number [plain] viewplaincopy # telnet &
A problem occurs when debugging a network program. when the service is started, the client cannot connect. First, you can use telnet to connect to the client;
The telnet IP port number is the same as that in Windows.
[Plain]View plain copy
- # Telnet to 192.168.0.107 1111
[Plain]View plain copy
- Trying 192.168.0.107...
- Telnet: connect to address 192.168.0.107: Connection timed out
The connection times out. it is estimated that it is a problem with Windows Firewall. my service runs on Windows;
Control Panel, system security, Windows Firewall, advanced settings, and new inbound rules;
Execute the telnet command to see if,
[Plain]View plain copy
- Trying 192.168.1.107...
- Connected to 192.168.1.107.
- Escape character is '^]'.
The connection is successful, which is indeed a Firewall problem!
Ah [é I], what's going on! Unable to return! Ctrl + c, Ctrl + z, ESC, q, quit, exit, none of them work;
Note:
[Plain]View plain copy
- Escape character is '^]'.
Ctrl +]
The posture is correct;
[Plain]View plain copy
- Telnet>?
- Commands may be abbreviated. Commands are:
- Close current connection
- Logout forcibly logout remote user and close the connection
- Display operating parameters
- Mode try to enter line or character mode ('mode? 'For more)
- Open connect to a site
- Quit exit telnet
- Send transmit special characters ('send? 'For more)
- Set operating parameters ('set? 'For more)
- Unset operating parameters ('unset? 'For more)
- Status print status information
- Toggle operating parameters ('toggle? 'For more)
- Slc change state of special charaters ('slc? 'For more)
- Z suspend telnet
- ! Invoke a subshell
- Environ change environment variables ('environ? 'For more)
- ? Print help information
- Telnet> close
- Connection closed.
Enter a question mark and press enter to view help;
Enter close or quit and press enter to exit telnet;