| 110 | } |
| 111 | |
| 112 | void TelnetConsole::setTelnetParameters(S32 port, const char *telnetPassword, const char *listenPassword, bool remoteEcho) |
| 113 | { |
| 114 | if(port == mAcceptPort) |
| 115 | return; |
| 116 | |
| 117 | mRemoteEchoEnabled = remoteEcho; |
| 118 | |
| 119 | if(mAcceptSocket != NetSocket::INVALID) |
| 120 | { |
| 121 | Net::closeSocket(mAcceptSocket); |
| 122 | mAcceptSocket = NetSocket::INVALID; |
| 123 | } |
| 124 | mAcceptPort = port; |
| 125 | if(mAcceptPort != -1 && mAcceptPort != 0) |
| 126 | { |
| 127 | NetAddress address; |
| 128 | Net::getIdealListenAddress(&address); |
| 129 | address.port = mAcceptPort; |
| 130 | |
| 131 | mAcceptSocket = Net::openSocket(); |
| 132 | Net::bindAddress(address, mAcceptSocket); |
| 133 | Net::listen(mAcceptSocket, 4); |
| 134 | |
| 135 | Net::setBlocking(mAcceptSocket, false); |
| 136 | } |
| 137 | dStrncpy(mTelnetPassword, telnetPassword, PasswordMaxLength); |
| 138 | dStrncpy(mListenPassword, listenPassword, PasswordMaxLength); |
| 139 | } |
| 140 | |
| 141 | void TelnetConsole::processConsoleLine(const char *consoleLine) |
| 142 | { |
no test coverage detected