The incomingConnection is now QTcpServer::incomingConnection(qintptr handle) If you use the old int handle it will compile without problem but it will never be fired...
Nancy Bellingan it is still not fired for me, why? If i do open 127.0.0.1 1234 it's saying "Could not open connection to the host, on port 1234: Connect failed". Why?
if you are on linux please run as root: netstat -toolpen |grep :1234 and see if another process is using this port. maybe you have already launched your program and not closed other instances.
I was pleasantly surprised. I stumbled upon this by accident and expected it to be crap but it was very well done. I just have two minor issues with this. 1. Don't include stuff in the header unless you have to. Use forward declarations and do the includes in the source file. 2. When you override a function it should not be declared protected unless you intend to further derive from that class. Those functions are protected in the base class you're deriving from but they should be private here.
Shouldn't you wait for client messages when you open the socket in the runnable instead of just closing it right away after a connection is made? I mean if you have a thread pool of 5 threads and actually wait for each client until they close the connection this becomes very simular to using QThreads... Except here you just limit the amout of sitmulatnius connecitons ...
nice....I have one question....You are printing the messages on the debugging window..But if i want to print message on some display widgets like Textbrowser..What should i do????
Still not able to call "incomingConnection(qintptr socketDescriptor)" and I don't know why. Telnet tells me Connectionproblem.... :( I'm using Qt 5 and changed int to qintptr .....
leonid vinikov well you handle them in your server readData constructor. That data received are just packets... So whatever you receive will be handled there..
@fuchofucho1 - that would be interesteing, not sure if Qt has built ion USB support
@micro1337 hmmm not sure, perhaps I should try to tackle this in the up-coming UDP videos?
The Mexican food joke ALMOST KILLED ME hahaha
Many thanks, your tutorial are indeed Educationally Entertaining =)
The incomingConnection is now
QTcpServer::incomingConnection(qintptr handle)
If you use the old int handle it will compile without problem but it will never be fired...
Nancy Bellingan it is still not fired for me, why? If i do open 127.0.0.1 1234 it's saying "Could not open connection to the host, on port 1234: Connect failed". Why?
did you check if the port is not used by another process?
Nancy Bellingan yes, it's saying Server Started. This is my "myserver.cpp": pastebin.com/sw3xNEws
if you are on linux please run as root:
netstat -toolpen |grep :1234
and see if another process is using this port.
maybe you have already launched your program and not closed other instances.
Check also if the port is blocked by the firewall for incomming connections...
I was pleasantly surprised. I stumbled upon this by accident and expected it to be crap but it was very well done. I just have two minor issues with this. 1. Don't include stuff in the header unless you have to. Use forward declarations and do the includes in the source file. 2. When you override a function it should not be declared protected unless you intend to further derive from that class. Those functions are protected in the base class you're deriving from but they should be private here.
You can't check if socket descriptor has been set or not by looking at its value! Integers don't have a default value, they could be anything.
Thank you for this great tutorial!
hello man,would you like to make a qt concurrent with tcpserver programmings
Shouldn't you wait for client messages when you open the socket in the runnable instead of just closing it right away after a connection is made?
I mean if you have a thread pool of 5 threads and actually wait for each client until they close the connection this becomes very simular to using QThreads... Except here you just limit the amout of sitmulatnius connecitons ...
It's 2021 and you're helping me get a job thanks.... also... 69 Noice
nice....I have one question....You are printing the messages on the debugging window..But if i want to print message on some display widgets like Textbrowser..What should i do????
could we achieve the source files of the course specifically for TCP? Udemy?
Still not able to call "incomingConnection(qintptr socketDescriptor)" and I don't know why. Telnet tells me Connectionproblem.... :( I'm using Qt 5 and changed int to qintptr .....
ok and now how i can handle more packets?
leonid vinikov well you handle them in your server readData constructor. That data received are just packets... So whatever you receive will be handled there..
I dont know why my opening 127.0.0.1 always stopped on connectting to 127.0.0.1
+Chunhui Wu I know,just argument in incomingConnection is qintptr now.
I didn't see the multithread demonstration here
ure stupid
Mai Loc whatever