标签:
int k = 1;
if( SUCCESS != m_socketServer.setSockOptSocket( SO_REUSEADDR, (char*)&k, sizeof(k), SOL_SOCKET ) ) {
PRINT("setSockOptSocket SO_REUSEADDR error\n");
}
linger m_sLinger;
m_sLinger.l_onoff = 1;
m_sLinger.l_linger = 0;
if( SUCCESS != m_socketServer.setSockOptSocket( SO_LINGER, (char*)&m_sLinger, sizeof(m_sLinger), SOL_SOCKET ) ) {
PRINT("setSockOptSocket SO_LINGER error\n");
}
标签:
原文地址:http://www.cnblogs.com/Neu400753645/p/5818621.html