After searching in this Qt Forum, I made attempt to write data on server by using below mentioned code, but it was not working.
void Server::writetoallclients()
{
foreach(QtcpSocket *socket,socket)
{
socket->write(Data.toUtf8().constData());
qDebug("data sent to all Clients");
}
}
void Server::writetoallclients()
{
QString Data="2allclients";
foreach(QtcpSocket *socket,socket)
{
socket->write(Data.toUtf8().constData());
qDebug("data sent to all Clients");
}
}
To copy to clipboard, switch view to plain text mode
void Client::read()
{
qDebug("start reading the socket");
qDebug("data rxcd from server ");
void Client::read()
{
qDebug("start reading the socket");
QByteArray buffer= socket->readLine();
qDebug("data rxcd from server ");
To copy to clipboard, switch view to plain text mode
Bookmarks