Fehler:‘class QAbstractSocket’ has no member named ‘bind’
if(socket()->socketType()==QAbstractSocket::UdpSocket) { (QUdpSocket)(socket())->bind( QHostAddress::Any, port ); }
This way it works:
if(socket()->socketType()==QAbstractSocket::UdpSocket) { static_cast<QUdpSocket *>(socket())->bind( QHostAddress::Any, port ); connect( static_cast<QUdpSocket *>(socket()), SIGNAL( readyRead() ), this, SLOT( readyRead() ) ); }