MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / setDebugParameters

Method setDebugParameters

Engine/source/console/telnetDebugger.cpp:235–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235void TelnetDebugger::setDebugParameters(S32 port, const char *password, bool waitForClient)
236{
237 // Don't bail if same port... we might just be wanting to change
238 // the password.
239// if(port == mAcceptPort)
240// return;
241
242 if(mAcceptSocket != NetSocket::INVALID)
243 {
244 Net::closeSocket(mAcceptSocket);
245 mAcceptSocket = NetSocket::INVALID;
246 }
247 mAcceptPort = port;
248 if(mAcceptPort != -1 && mAcceptPort != 0)
249 {
250 NetAddress address;
251 Net::getIdealListenAddress(&address);
252 address.port = mAcceptPort;
253
254 mAcceptSocket = Net::openSocket();
255 Net::bindAddress(address, mAcceptSocket);
256 Net::listen(mAcceptSocket, 4);
257
258 Net::setBlocking(mAcceptSocket, false);
259 }
260 dStrncpy(mDebuggerPassword, password, PasswordMaxLength);
261
262 mWaitForClient = waitForClient;
263 if ( !mWaitForClient )
264 return;
265
266 // Wait for the client to fully connect.
267 while ( mState != Connected )
268 {
269 Platform::sleep(10);
270 process();
271 }
272
273}
274
275void TelnetDebugger::processConsoleLine(const char *consoleLine)
276{

Callers 1

telnetDebugger.cppFile · 0.80

Calls 1

dStrncpyFunction · 0.85

Tested by

no test coverage detected