14 g_rconSession->disconnect(); |
14 g_rconSession->disconnect(); |
15 delete g_rconSession; |
15 delete g_rconSession; |
16 } |
16 } |
17 |
17 |
18 g_rconSession = this; |
18 g_rconSession = this; |
19 |
19 } |
20 if (not m_socket.set_blocking (false)) |
20 |
21 { |
21 // ------------------------------------------------------------------------------------------------- |
22 // TODO: find a better way to deal with errors |
22 // |
|
23 STATIC METHOD |
|
24 RCONSession::new_session() -> RCONSession* |
|
25 { |
|
26 RCONSession* session = new RCONSession; |
|
27 |
|
28 if (not session->socket()->set_blocking (false)) |
|
29 { |
23 print ("unable to set socket as non-blocking: %s\n", |
30 print ("unable to set socket as non-blocking: %s\n", |
24 m_socket.error_string().chars()); |
31 session->socket()->error_string().chars()); |
25 } |
32 delete session; |
|
33 return nullptr; |
|
34 } |
|
35 |
|
36 return session; |
26 } |
37 } |
27 |
38 |
28 // ------------------------------------------------------------------------------------------------- |
39 // ------------------------------------------------------------------------------------------------- |
29 // |
40 // |
30 RCONSession::~RCONSession() |
41 RCONSession::~RCONSession() |