csvivek
16th October 2008, 06:44
Hi,
I have a udpserver that is waiting for a data from a client to be connected and this server is written in C. Now i have a client who can send and receive data to this server. This client is coded with QT. I am able to send data to this server thru the writeDatagram() cal. but to recieve the data. I have used the readyRead() signal. but the slot connected is not at all getting called.
I have not binded the object of QUdpSocket to the corresponding port or IP at the client side.
I thought this would be the problem but when i try to bind the object. Bind is getting failed. when both the client and server are running in the same pc. i have also tried with different pc's where the bind is a success and the client server are working fine.
Please tell me a way where i can make the binding success when both the client and server are running the same PC.
I tried using the following code but still the problem exists with same PC.
if(m_udpsocket->bind(port,QUdpSocket::ReuseAddressHint|QUdpSocket: :ShareAddress))
qDebug("Bind Success");
else
qDebug("Bind Fail");
kindly help me..
Thanks in advance.
I have a udpserver that is waiting for a data from a client to be connected and this server is written in C. Now i have a client who can send and receive data to this server. This client is coded with QT. I am able to send data to this server thru the writeDatagram() cal. but to recieve the data. I have used the readyRead() signal. but the slot connected is not at all getting called.
I have not binded the object of QUdpSocket to the corresponding port or IP at the client side.
I thought this would be the problem but when i try to bind the object. Bind is getting failed. when both the client and server are running in the same pc. i have also tried with different pc's where the bind is a success and the client server are working fine.
Please tell me a way where i can make the binding success when both the client and server are running the same PC.
I tried using the following code but still the problem exists with same PC.
if(m_udpsocket->bind(port,QUdpSocket::ReuseAddressHint|QUdpSocket: :ShareAddress))
qDebug("Bind Success");
else
qDebug("Bind Fail");
kindly help me..
Thanks in advance.