summaryrefslogtreecommitdiffstats
path: root/src/network/doc/snippets/code/src_network_socket_qlocalsocket_unix.cpp
blob: e6459a02d2856fac52f16ac6f43c9526899edf95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

//! [0]
socket->connectToServer("market");
if (socket->waitForConnected(1000))
    qDebug("Connected!");
//! [0]


//! [1]
socket->disconnectFromServer();
if (socket->state() == QLocalSocket::UnconnectedState
    || socket->waitForDisconnected(1000)) {
    qDebug("Disconnected!");
}
//! [1]