PDA

View Full Version : Nerwork connect function



havij000
30th September 2013, 13:10
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?
:confused:

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.

Rajesh.Rathod
30th September 2013, 13:22
see below link which gives example for socket programming in Qt... see if it solves your problem

http://www.vision.ee.ethz.ch/computing/sepp-irix/qt-3.0-mo/clientserver-example.html

anda_skoa
30th September 2013, 22:15
Since you are not using Qt for the network setup, why do you ask on this forum?

Cheers,
_

havij000
1st October 2013, 07:08
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,

anda_skoa
1st October 2013, 11:13
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,
_