Then, When here is a new connection, we can add it to the client list and prepare to read/write on the socket. like that: _server.listen(QHostAddress::Any, 4242) Ĭonnect(&_server, SIGNAL(newConnection()), this, SLOT(onNewConnection())) Retrieved 5 December 2012.Create a TCP server in Qt is also very easy, indeed, the class QTcpServer already provide all we need to do the server.įirst, we need to listen to any ip, a random port and do something when a client is connected.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |