homescreenapp/hsdomainmodel/src/hsipcchannelhost.cpp
changeset 36 cdae8c6c3876
parent 35 f9ce957a272c
child 39 4e8ebe173323
equal deleted inserted replaced
35:f9ce957a272c 36:cdae8c6c3876
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 #include <QDebug>
       
    18 #include "hsipcchannelhost.h"
       
    19 
       
    20 /*!
       
    21     \class HsIpcChannelHost
       
    22     \ingroup group_hsutils
       
    23     \brief Homescreen ipc transport channel server api.
       
    24     
       
    25     Server side communication channel management. 
       
    26 
       
    27 */
       
    28 
       
    29 HsIpcChannelHost::HsIpcChannelHost(QLocalSocket *socket,QObject *parent)
       
    30     : HsIpcChannel(parent)
       
    31 {
       
    32     Q_ASSERT(socket);
       
    33 
       
    34     mSocket = socket;
       
    35     connect(mSocket, SIGNAL(error(QLocalSocket::LocalSocketError)), 
       
    36             SLOT(onError(QLocalSocket::LocalSocketError)));
       
    37     connect(mSocket, SIGNAL(readyRead()), SLOT(onReadyRead()));
       
    38     connect(mSocket, SIGNAL(disconnected()), SIGNAL(disconnected()));
       
    39     qDebug()<< "HsIpcChannelHost::HsIpcChannelHost(): " << (int)this;
       
    40 }
       
    41 
       
    42 HsIpcChannelHost::~HsIpcChannelHost()
       
    43 {
       
    44     qDebug()<< "HsIpcChannelHost::~HsIpcChannelHost(): " << (int)this;
       
    45     delete mSocket;
       
    46 }
       
    47 
       
    48 void HsIpcChannelHost::closeConnection()
       
    49 {
       
    50     mSocket->close();
       
    51 }