just a wild guess, but can your C code send back the socket descriptor to the GUI code, and then let Qt close the socket?
then perhaps you can do something like this:
int sd = C_CodeFunction();
if(udp->setSocketDescriptor(sd))
{
QObject::connect(udp,
SIGNAL(readyRead
()), your_obj,
SLOT(your_slot
()));
}
int sd = C_CodeFunction();
QUdpSocket *udp = new QUdpSocket;
if(udp->setSocketDescriptor(sd))
{
QObject::connect(udp, SIGNAL(readyRead()), your_obj, SLOT(your_slot()));
}
To copy to clipboard, switch view to plain text mode
or something to that effect.
Bookmarks