| 274 | } |
| 275 | |
| 276 | void CNetConnection::Disconnect(const char *pReason) |
| 277 | { |
| 278 | if(State() == EState::OFFLINE) |
| 279 | return; |
| 280 | |
| 281 | if(m_RemoteClosed == 0) |
| 282 | { |
| 283 | if(!m_TimeoutSituation) |
| 284 | { |
| 285 | if(pReason) |
| 286 | SendControl(NET_CTRLMSG_CLOSE, pReason, str_length(pReason) + 1); |
| 287 | else |
| 288 | SendControl(NET_CTRLMSG_CLOSE, nullptr, 0); |
| 289 | } |
| 290 | |
| 291 | if(pReason != m_aErrorString) |
| 292 | { |
| 293 | m_aErrorString[0] = 0; |
| 294 | if(pReason) |
| 295 | str_copy(m_aErrorString, pReason); |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | Reset(); |
| 300 | } |
| 301 | |
| 302 | void CNetConnection::DirectInit(const NETADDR &Addr, SECURITY_TOKEN SecurityToken, SECURITY_TOKEN Token, bool Sixup) |
| 303 | { |
no test coverage detected