Results 1 to 5 of 5

Thread: Nerwork connect function

  1. #1
    Join Date
    Nov 2012
    Posts
    48
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Nerwork connect function

    Hi every body,

    I am new to Qt and now want to write a TCP client/server socket program in Qt.
    Unfortunately when I use the connect funtion, it returns -1 even to make a connection to localhost.
    Who know what the problem is?



    Added after 36 minutes:


    how can run a client and a server application on two different computer in a network?
    Both the client and the server are c++ application which are wtitten in Qt but not with the QNetwork.
    Last edited by havij000; 30th September 2013 at 12:10.
    Regards,

  2. #2
    Join Date
    Apr 2012
    Location
    India.
    Posts
    88
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Nerwork connect function

    see below link which gives example for socket programming in Qt... see if it solves your problem

    http://www.vision.ee.ethz.ch/computi...r-example.html
    Last edited by Rajesh.Rathod; 30th September 2013 at 12:29.

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Nerwork connect function

    Since you are not using Qt for the network setup, why do you ask on this forum?

    Cheers,
    _

  4. #4
    Join Date
    Nov 2012
    Posts
    48
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Nerwork connect function

    since this network code is a part of an application whic I have written in qt, thus I have to write this part in qt but I dont want to use Qnetwork,
    Regards,

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Nerwork connect function

    Sure, but your problem is not in any code that uses Qt, right?
    Why would you expect anyone to know what an unknown function is doing or why it is returning a certain value?

    Consult the documentation of the API that you are using. It should have information about what the meaning of return values of its functions are.

    Cheers,
    _

Similar Threads

  1. Connect to global function?
    By hakermania in forum Newbie
    Replies: 2
    Last Post: 3rd September 2011, 16:36
  2. Replies: 4
    Last Post: 14th August 2011, 15:37
  3. Connect slot to an int function !?
    By hakermania in forum Newbie
    Replies: 23
    Last Post: 30th December 2010, 12:08
  4. connect between function of two differents QWidget
    By shenakan in forum Qt Programming
    Replies: 3
    Last Post: 9th September 2010, 18:32
  5. connect a QPushButton matrix with a function
    By harmodrew in forum Newbie
    Replies: 6
    Last Post: 6th August 2010, 11:11

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.