.
.
.
tcpSocket1
->connectToHost
("192.168.0.101",
800,
QIODevice::ReadWrite);
if(tcpSocket1->socketDescriptor() > 0)
tcpSocket = tcpSocket1;
if (!tcpSocket->waitForConnected(Timeout))
return;
connect( tcpSocket, SIGNAL(readyRead()), this, SLOT(read_data()));
.
.
.
void Common::send_sock_data_1(int G_sock_data_len)
{
int byte_send = 0;
if(tcpSocket == NULL) return;
qDebug("TCP socket is %d\n", tcpSocket->state());
if ( tcpSocket->isValid() )
{
byte_send = tcpSocket->write(G_sock_data_1, G_sock_data_len);
.
.
.
.
.
.
tcpSocket1 = new QTcpSocket();
tcpSocket1->connectToHost("192.168.0.101", 800, QIODevice::ReadWrite);
if(tcpSocket1->socketDescriptor() > 0)
tcpSocket = tcpSocket1;
if (!tcpSocket->waitForConnected(Timeout))
return;
connect( tcpSocket, SIGNAL(readyRead()), this, SLOT(read_data()));
connect( tcpSocket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(displayError(QAbstractSocket::SocketError)));
.
.
.
void Common::send_sock_data_1(int G_sock_data_len)
{
int byte_send = 0;
if(tcpSocket == NULL) return;
qDebug("TCP socket is %d\n", tcpSocket->state());
if(tcpSocket->state() != QAbstractSocket::ConnectedState ) return;
if ( tcpSocket->isValid() )
{
byte_send = tcpSocket->write(G_sock_data_1, G_sock_data_len);
.
.
.
To copy to clipboard, switch view to plain text mode
Bookmarks