I am experiencing problems with a program using SocketService / Port similar to demo/tcpservie.c. In fact it was initially derived from that program.
The problem is, that once all client disconnect from the server it eats up all cpu usage. I delete the SocketPort class instance when the last client disconnects and it is being removed from the SocketService port list.
I inserted an output line right behind
port=first
while(port)
in SocketService::Run (the big loop). It is normally not being called after the deletion of the last SocketPort.
Sometimes though it is.... and then it just goes nuts.
Also the programm generates an extra thread when the last connection is closed. That thread is the one eating all the cpu time.
Sometimes the cpu usage goes back to a normal level when I reconnect to the program.
Any ideas, suggestions or comments on this problem would be greatly appreciated.
Best Regards
Jens
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am experiencing problems with a program using SocketService / Port similar to demo/tcpservie.c. In fact it was initially derived from that program.
The problem is, that once all client disconnect from the server it eats up all cpu usage. I delete the SocketPort class instance when the last client disconnects and it is being removed from the SocketService port list.
I inserted an output line right behind
port=first
while(port)
in SocketService::Run (the big loop). It is normally not being called after the deletion of the last SocketPort.
Sometimes though it is.... and then it just goes nuts.
Also the programm generates an extra thread when the last connection is closed. That thread is the one eating all the cpu time.
Sometimes the cpu usage goes back to a normal level when I reconnect to the program.
Any ideas, suggestions or comments on this problem would be greatly appreciated.
Best Regards
Jens
I found the bug myself. I am going to post what I think is a bugfix to the problem.
Hope noone looked into it too much yet.
Regards
Jens
I will look at it when it's posted.