Results 1 to 3 of 3

Thread: emit error for QLocalSocket

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Location
    Hyderabad, India
    Posts
    25
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default emit error for QLocalSocket

    Hi,

    I am implementing 'Local fortune server' example (from Qt 4.7.3) as a service on Windows.
    What i want is that when someone paused the service, the local server should notify the error to the connected local socket (local fortune client). The error can be QLocalSocket::ServerNotFoundError.
    Now, How to generate this error from server example. Please look at the following code where i want to generate this error.


    Qt Code:
    1. void FortuneServer::incomingConnection(quintptr socketDescriptor)
    2. {
    3. if (disabled) {
    4. [B]// here i want to emit QLocalSocket::ServerNotFoundError [/B]
    5. return;
    6. }
    7.  
    8. QString fortune = fortunes.at(qrand() % fortunes.size());
    9. FortuneThread *thread = new FortuneThread(socketDescriptor, fortune, this);
    10. connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
    11. thread->start();
    12. }
    13.  
    14. void FortuneServer:: pause()
    15. {
    16. disabled = true;
    17. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by high_flyer; 31st August 2011 at 08:53. Reason: code tags

Similar Threads

  1. QLocalSocket issue/difference between *nix & win32
    By CmdrMoozy in forum Qt Programming
    Replies: 9
    Last Post: 30th January 2012, 15:18
  2. Transparent QLocalSocket and QTcpSocket use
    By chiiph in forum Qt Programming
    Replies: 0
    Last Post: 12th November 2010, 16:35
  3. QLocalSocket Synchronicity
    By matic in forum Qt Programming
    Replies: 0
    Last Post: 25th March 2010, 12:04
  4. Using QLocalServer and QLocalSocket
    By danc81 in forum Qt Programming
    Replies: 0
    Last Post: 10th November 2009, 12:09
  5. IPC with QLocalServer/QLocalSocket
    By ManuMies in forum Qt Programming
    Replies: 1
    Last Post: 11th February 2009, 20:09

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.