// QString string("192.168.112.10")
// QHostAddress address(QHostAddress::LocalHost)//QHostAddress::Any
// bool tf =address.setAddress( string )
// tf =m_pSocket->bind(address,m_port )//失败
// quint32 ip4Add = 192<<24|168<<16|112<<8|10
// QHostAddress address(QHostAddress::Any)//QHostAddress::LocalHost
// 蚂埋 address.setAddress( ip4Add )
// bool tf =m_pSocket->bind(address,m_port )//失败
//quint32 ip4Add = 192<<24|168<<16|112<<8|100
//bool tf =m_pSocket->bind(QHostAddress(ip4Add),m_port,QAbstractSocket::ShareAddress )
/销吵/tf =m_pSocket->bind(QHostAddress(ip4Add),m_port,QAbstractSocket::ReuseAddressHint| QAbstractSocket::ShareAddress | QAbstractSocket::DontShareAddress )
//tf =m_pSocket->bind(QHostAddress("192.168.112.100"),m_port,QAbstractSocket::ReuseAddressHint| QAbstractSocket::ShareAddress | QAbstractSocket::DontShareAddress )//失败
// 亏物侍 tf =m_pSocket->bind(QHostAddress("192.168.112.100"),m_port,QAbstractSocket::ReuseAddressHint )
// tf =m_pSocket->bind(QHostAddress("192.168.112.100"),m_port,QAbstractSocket::ShareAddress )
// tf =m_pSocket->bind(QHostAddress("192.168.112.100"),m_port,QAbstractSocket::DontShareAddress )
//tf =m_pSocket->bind(QHostAddress("192.168.112.100"),m_port,QAbstractSocket::ReuseAddressHint | QAbstractSocket::ShareAddress )
//tf =m_pSocket->bind(QHostAddress("192.168.112.100"),m_port,QAbstractSocket::DontShareAddress | QAbstractSocket::ReuseAddressHint )
//tf =m_pSocket->bind(QHostAddress("192.168.112.100"),m_port,QAbstractSocket::DontShareAddress | QAbstractSocket::ShareAddress )
//m_pSocket->bind(QHostAddress::Any, m_port )//方便使用
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)