QTcpSocket* s = new QTcpSocket(this); s->bind(QHostAddress("192.168.0.11"), 0); s->connectToHost(QHostAddress("192.168.0.22"), 1234, QIODevice::ReadWrite);