Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any example on httpserver with threaded(QThread) or ThreadedHttpServer. #51

Open
kingctan opened this issue Oct 19, 2014 · 10 comments
Open

Comments

@kingctan
Copy link

I am new to tufao. and have no idea about the thead use of tufao, So, the following code maybe stupid.
1.

    HttpServer *server;

    WebThread webthread(server);  # 

    server->moveToThread(&webthread);

    webthread.start();

run with the fellowing error and exit.

QML debugging is enabled. Only use this in a safe environment.
Error - RtlWerpReportException failed with status code :-1073741823. Will try to launch the process directly

when using ThreadedHttpServer in the main.cpp, build result show:

E:\...\main.cpp:75: error: undefined reference to `Tufao::ThreadedHttpServer::ThreadedHttpServer(QObject*)'

How?

and if any example about ThreadedHttpServer will be great. and I want to set the Url Route.

Please help,Thanks.

@kingctan kingctan changed the title Any example on httpserver with threaded(QThread), I use it in thread failed. Any example on httpserver with threaded(QThread) or ThreadedHttpServer. Oct 19, 2014
@vinipsmaker
Copy link
Owner

Are you using a stable Tufão release?

@kingctan
Copy link
Author

no, I downloaded from github tufao main page.

@vinipsmaker
Copy link
Owner

try one of the tagged releases: https://github.com/vinipsmaker/tufao/releases

I guarantee no API/ABI/low-amount-of-bugs over the development branches

btw, there are threads examples:

@vinipsmaker
Copy link
Owner

reopen the issue if the problem persist

@kingctan
Copy link
Author

are you stay on the irc channel?

@vinipsmaker
Copy link
Owner

are you stay on the irc channel?

sorry, i use an IRC bouncer and i read IRC messages like email, not like IM

i'm there now

@kingctan
Copy link
Author

for the kiwiirc's disconnection,maybe we can't see messages for each other now. I'll paste my test here.

1). after tested for several times. found:

QThread: Destroyed while thread is still running 
Error - RtlWerpReportException failed with status code :-1073741823. Will try to launch the process directly 

and quit then.

2). when open url in browser and refresh the browser,the qtcreator will show log:

QObject: Cannot create children for a parent that is in a different thread.
(Parent is Worker(0x1c1de678), parent's thread is QThread(0x1c1dbb90), current thread is QThread(0x1c1f16b0)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Worker(0x1c1de480), parent's thread is QThread(0x1c1dbbe0), current thread is QThread(0x1c1f16e0)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Worker(0x1c1de678), parent's thread is QThread(0x1c1dbb90), current thread is QThread(0x1c1f16b0)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Worker(0x1c1de678), parent's thread is QThread(0x1c1dbb90), current thread is QThread(0x1c1f16b0)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Worker(0x1c1de678), parent's thread is QThread(0x1c1dbb90), current thread is QThread(0x1c1f16b0)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Worker(0x1c1de678), parent's thread is QThread(0x1c1dbb90), current thread is QThread(0x1c1f16b0)

@vinipsmaker
Copy link
Owner

what platform are you using? are you running the same code?

after tested for several times

thanks for the feedback. can you test after this new commit i made seconds ago?

@kingctan
Copy link
Author

QT5.3,WIN7,1.x C++11.
tested also see:

QObject: Cannot create children for a parent that is in a different thread.
(Parent is Worker(0x1c1de678), parent's thread is QThread(0x1c1dbb90), current thread is QThread(0x1c1f16b0)

@vinipsmaker
Copy link
Owner

i'd like to help more, but you'll need to take the issue to the upstream qt guys

@vinipsmaker vinipsmaker reopened this Oct 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants