uNetworking / uWebSockets

Simple, secure & standards compliant web server for the most demanding of applications
Apache License 2.0
17.03k stars 1.75k forks source link

EchoServer executed failed without output. #1060

Closed Shinefallen closed 4 years ago

Shinefallen commented 4 years ago

I compiled the EchoServer.cpp with WITH_OPENSSL=1 flag successfully. But when i ran EchoServer, it failed directly without output. The progress did not wait at "app.run()", Thanks very much~

`[root@abc uWebSockets]# WITH_OPENSSL=1 make

make -C uSockets make[1]: Entering directory '/home/abc/uWebSockets/uSockets' rm -f .o cc -DLIBUS_USE_OPENSSL -std=c11 -Isrc -flto -O3 -c src/.c src/eventing/.c src/crypto/.c ar rvs uSockets.a .o r - context.o r - epoll_kqueue.o r - gcd.o r - libuv.o r - loop.o r - openssl.o r - socket.o r - wolfssl.o ar: context.o: plugin needed to handle lto object ar: epoll_kqueue.o: plugin needed to handle lto object ar: gcd.o: plugin needed to handle lto object ar: libuv.o: plugin needed to handle lto object ar: loop.o: plugin needed to handle lto object ar: openssl.o: plugin needed to handle lto object ar: socket.o: plugin needed to handle lto object ar: wolfssl.o: plugin needed to handle lto object make[1]: Leaving directory '/home/abc/uWebSockets/uSockets' g++ -flto -O3 -lpthread -Wconversion -std=c++17 -Isrc -IuSockets/src examples/HelloWorld.cpp -o HelloWorld uSockets/.o -lz -lssl -lcrypto; g++ -flto -O3 -lpthread -Wconversion -std=c++17 -Isrc -IuSockets/src examples/EchoServer.cpp -o EchoServer uSockets/.o -lz -lssl -lcrypto; g++ -flto -O3 -lpthread -Wconversion -std=c++17 -Isrc -IuSockets/src examples/BroadcastingEchoServer.cpp -o BroadcastingEchoServer uSockets/.o -lz -lssl -lcrypto; g++ -pthread -flto -O3 -lpthread -Wconversion -std=c++17 -Isrc -IuSockets/src examples/HelloWorldThreaded.cpp -o HelloWorldThreaded uSockets/.o -lz -lssl -lcrypto; g++ -pthread -flto -O3 -lpthread -Wconversion -std=c++17 -Isrc -IuSockets/src examples/EchoServerThreaded.cpp -o EchoServerThreaded uSockets/.o -lz -lssl -lcrypto;

[root@abc uWebSockets]# ./EchoServer

[root@abc uWebSockets]# `

ghost commented 4 years ago

It fails because it can't find your cert or key, it could be made to print such a message

KevinMarkVine commented 8 months ago

I compiled the EchoServer.cpp with WITH_OPENSSL=1 flag successfully. But when i ran EchoServer, it failed directly without output. The progress did not wait at "app.run()", Thanks very much~

`[root@abc uWebSockets]# WITH_OPENSSL=1 make

make -C uSockets make[1]: Entering directory '/home/abc/uWebSockets/uSockets' rm -f _.o cc -DLIBUS_USEOPENSSL -std=c11 -Isrc -flto -O3 -c src/.c src/eventing/.c src/crypto/.c ar rvs uSockets.a _.o r - context.o r - epoll_kqueue.o r - gcd.o r - libuv.o r - loop.o r - openssl.o r - socket.o r - wolfssl.o ar: context.o: plugin needed to handle lto object ar: epollkqueue.o: plugin needed to handle lto object ar: gcd.o: plugin needed to handle lto object ar: libuv.o: plugin needed to handle lto object ar: loop.o: plugin needed to handle lto object ar: openssl.o: plugin needed to handle lto object ar: socket.o: plugin needed to handle lto object ar: wolfssl.o: plugin needed to handle lto object make[1]: Leaving directory '/home/abc/uWebSockets/uSockets' g++ -flto -O3 -lpthread -Wconversion -std=c++17 -Isrc -IuSockets/src examples/HelloWorld.cpp -o HelloWorld uSockets/.o -lz -lssl -lcrypto; g++ -flto -O3 -lpthread -Wconversion -std=c++17 -Isrc -IuSockets/src examples/EchoServer.cpp -o EchoServer uSockets/.o -lz -lssl -lcrypto; g++ -flto -O3 -lpthread -Wconversion -std=c++17 -Isrc -IuSockets/src examples/BroadcastingEchoServer.cpp -o BroadcastingEchoServer uSockets/.o -lz -lssl -lcrypto; g++ -pthread -flto -O3 -lpthread -Wconversion -std=c++17 -Isrc -IuSockets/src examples/HelloWorldThreaded.cpp -o HelloWorldThreaded uSockets/.o -lz -lssl -lcrypto; g++ -pthread -flto -O3 -lpthread -Wconversion -std=c++17 -Isrc -IuSockets/src examples/EchoServerThreaded.cpp -o EchoServerThreaded uSockets/.o -lz -lssl -lcrypto;

[root@abc uWebSockets]# ./EchoServer

[root@abc uWebSockets]# `

So did you solve it ?

uNetworkingAB commented 8 months ago

You need to apply yourself and look in the example. You can see that a certain print is not happening, so the opposite is the case. You can figure this out with some very basic printf debugging in worst case. Listen fails, for some reason. Like was already written above.