Replies: 1 comment
-
solved by modify the examples's code, add some parameters to match the "WebSocketBehavior" struct;and websocket.h "static const int MAX_CLOSE_PAYLOAD = 123" -> "static const long unsigned int MAX_CLOSE_PAYLOAD = 123" |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I did like these step:
Then show these messages below (warning, error, note):
[root@VM-0-6-centos uWebSockets]# make
make -C uSockets;
for FILE in Broadcast HelloWorld ServerName EchoServer BroadcastingEchoServer UpgradeSync UpgradeAsync; do g++ -flto -O3 -lpthread -Wpedantic -Wall -Wextra -Wsign-conversion -Wconversion -std=c++2a -Isrc -IuSockets/src examples/$FILE.cpp -o $FILE uSockets/.o -lz & done;
for FILE in HelloWorldThreaded EchoServerThreaded; do g++ -pthread -flto -O3 -lpthread -Wpedantic -Wall -Wextra -Wsign-conversion -Wconversion -std=c++2a -Isrc -IuSockets/src examples/$FILE.cpp -o $FILE uSockets/.o -lz & done;
wait
make[1]: Entering directory '/root/tools/C++/uWebSockets/uSockets'
rm -f .o
cc -DLIBUS_NO_SSL -std=c11 -Isrc -flto -O3 -c src/.c src/eventing/.c src/crypto/.c
ar rvs uSockets.a .o
r - bsd.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: bsd.o: plugin needed to handle lto object
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 '/root/tools/C++/uWebSockets/uSockets'
In file included from src/HttpResponse.h:31,
from src/App.h:41,
from examples/EchoServer.cpp:2:
src/WebSocket.h: In member function ‘void uWS::WebSocket<, , >::end(int, std::string_view)’:
src/WebSocket.h:178:45: warning: conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
char closePayload[MAX_CLOSE_PAYLOAD + 2];
~~~~~~~~~~~~~~~~~~^~~
In file included from src/HttpResponse.h:31,
from src/App.h:41,
from examples/Broadcast.cpp:2:
src/WebSocket.h: In member function ‘void uWS::WebSocket<, , >::end(int, std::string_view)’:
src/WebSocket.h:178:45: warning: conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
char closePayload[MAX_CLOSE_PAYLOAD + 2];
~~~~~~~~~~~~~~~~~~^~~
In file included from src/HttpResponse.h:31,
from src/App.h:41,
from examples/HelloWorldThreaded.cpp:1:
src/WebSocket.h: In member function ‘void uWS::WebSocket<, , >::end(int, std::string_view)’:
src/WebSocket.h:178:45: warning: conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
char closePayload[MAX_CLOSE_PAYLOAD + 2];
~~~~~~~~~~~~~~~~~~^~~
In file included from src/HttpResponse.h:31,
from src/App.h:41,
from examples/UpgradeSync.cpp:2:
src/WebSocket.h: In member function ‘void uWS::WebSocket<, , >::end(int, std::string_view)’:
src/WebSocket.h:178:45: warning: conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
char closePayload[MAX_CLOSE_PAYLOAD + 2];
~~~~~~~~~~~~~~~~~~^~~
In file included from src/HttpResponse.h:31,
from src/App.h:41,
from examples/EchoServerThreaded.cpp:1:
src/WebSocket.h: In member function ‘void uWS::WebSocket<, , >::end(int, std::string_view)’:
src/WebSocket.h:178:45: warning: conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
char closePayload[MAX_CLOSE_PAYLOAD + 2];
~~~~~~~~~~~~~~~~~~^~~
In file included from src/HttpResponse.h:31,
from src/App.h:41,
from examples/BroadcastingEchoServer.cpp:1:
src/WebSocket.h: In member function ‘void uWS::WebSocket<, , >::end(int, std::string_view)’:
src/WebSocket.h:178:45: warning: conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
char closePayload[MAX_CLOSE_PAYLOAD + 2];
~~~~~~~~~~~~~~~~~~^~~
In file included from src/HttpResponse.h:31,
from src/App.h:41,
from examples/UpgradeAsync.cpp:2:
src/WebSocket.h: In member function ‘void uWS::WebSocket<, , >::end(int, std::string_view)’:
src/WebSocket.h:178:45: warning: conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
char closePayload[MAX_CLOSE_PAYLOAD + 2];
~~~~~~~~~~~~~~~~~~^~~
In file included from src/HttpResponse.h:31,
from src/App.h:41,
from examples/HelloWorld.cpp:1:
src/WebSocket.h: In member function ‘void uWS::WebSocket<, , >::end(int, std::string_view)’:
src/WebSocket.h:178:45: warning: conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
char closePayload[MAX_CLOSE_PAYLOAD + 2];
~~~~~~~~~~~~~~~~~~^~~
examples/EchoServer.cpp: In function ‘int main()’:
examples/EchoServer.cpp:50:6: error: no matching function for call to ‘uWS::TemplatedApp::ws<main()::PerSocketData>(const char [3], )’
}).listen(9001, [](auto listen_socket) {
^
In file included from examples/EchoServer.cpp:2:
src/App.h:220:20: note: candidate: ‘template uWS::TemplatedApp&& uWS::TemplatedApp::ws(std::__cxx11::string, uWS::TemplatedApp::WebSocketBehavior&&) [with UserData = UserData; bool SSL = true]’
TemplatedApp &&ws(std::string pattern, WebSocketBehavior &&behavior) {
^~
src/App.h:220:20: note: template argument deduction/substitution failed:
examples/EchoServer.cpp:50:6: note: cannot convert ‘{((uWS::CompressOptions)((short unsigned int)(146 | 3840))), ((100 * 1024) * 1024), 16, ((100 * 1024) * 1024), false, false, true, nullptr, main()::<lambda(auto:11)>{}, main()::<lambda(auto:12, std::string_view, uWS::OpCode)>{}, main()::<lambda(auto:13*)>{}, main()::<lambda(auto:14*, std::string_view)>{}, main()::<lambda(auto:15*, std::string_view)>{}, main()::<lambda(auto:16*, int, std::string_view)>{}}’ (type ‘’) to type ‘uWS::TemplatedApp::WebSocketBehavior<main()::PerSocketData>&&’
}).listen(9001, [](auto listen_socket) {
^
examples/Broadcast.cpp: In function ‘int main()’:
examples/Broadcast.cpp:54:6: error: no matching function for call to ‘uWS::TemplatedApp::ws<main()::PerSocketData>(const char [3], )’
}).listen(9001, [](auto listen_socket) {
^
In file included from examples/Broadcast.cpp:2:
src/App.h:220:20: note: candidate: ‘template uWS::TemplatedApp&& uWS::TemplatedApp::ws(std::__cxx11::string, uWS::TemplatedApp::WebSocketBehavior&&) [with UserData = UserData; bool SSL = true]’
TemplatedApp &&ws(std::string pattern, WebSocketBehavior &&behavior) {
^~
src/App.h:220:20: note: template argument deduction/substitution failed:
examples/Broadcast.cpp:54:6: note: cannot convert ‘{SHARED_COMPRESSOR, ((16 * 1024) * 1024), 16, ((1 * 1024) * 1024), false, false, true, nullptr, main()::<lambda(auto:11)>{}, main()::<lambda(auto:12, std::string_view, uWS::OpCode)>{}, main()::<lambda(auto:13*)>{}, main()::<lambda(auto:14*, std::string_view)>{}, main()::<lambda(auto:15*, std::string_view)>{}, main()::<lambda(auto:16*, int, std::string_view)>{}}’ (type ‘’) to type ‘uWS::TemplatedApp::WebSocketBehavior<main()::PerSocketData>&&’
}).listen(9001, [](auto listen_socket) {
^
examples/UpgradeSync.cpp: In function ‘int main()’:
examples/UpgradeSync.cpp:72:6: error: no matching function for call to ‘uWS::TemplatedApp::ws<main()::PerSocketData>(const char [3], )’
}).listen(9001, [](auto listen_socket) {
^
In file included from examples/UpgradeSync.cpp:2:
src/App.h:220:20: note: candidate: ‘template uWS::TemplatedApp&& uWS::TemplatedApp::ws(std::__cxx11::string, uWS::TemplatedApp::WebSocketBehavior&&) [with UserData = UserData; bool SSL = true]’
TemplatedApp &&ws(std::string pattern, WebSocketBehavior &&behavior) {
^~
src/App.h:220:20: note: template argument deduction/substitution failed:
examples/UpgradeSync.cpp:72:6: note: cannot convert ‘{SHARED_COMPRESSOR, (16 * 1024), 10, ((1 * 1024) * 1024), main()::<lambda(auto:11, auto:12, auto:13*)>{}, main()::<lambda(auto:14*)>{}, main()::<lambda(auto:15*, std::string_view, uWS::OpCode)>{}, main()::<lambda(auto:16*)>{}, main()::<lambda(auto:17*, std::string_view)>{}, main()::<lambda(auto:18*, std::string_view)>{}, main()::<lambda(auto:19*, int, std::string_view)>{}}’ (type ‘’) to type ‘uWS::TemplatedApp::WebSocketBehavior<main()::PerSocketData>&&’
}).listen(9001, [](auto listen_socket) {
^
examples/EchoServerThreaded.cpp: In lambda function:
examples/EchoServerThreaded.cpp:44:14: error: no matching function for call to ‘uWS::TemplatedApp::ws<main()::PerSocketData>(const char [3], )’
}).listen(9001, [](auto listen_socket) {
^
In file included from examples/EchoServerThreaded.cpp:1:
src/App.h:220:20: note: candidate: ‘template uWS::TemplatedApp&& uWS::TemplatedApp::ws(std::__cxx11::string, uWS::TemplatedApp::WebSocketBehavior&&) [with UserData = UserData; bool SSL = false]’
TemplatedApp &&ws(std::string pattern, WebSocketBehavior &&behavior) {
^~
src/App.h:220:20: note: template argument deduction/substitution failed:
examples/EchoServerThreaded.cpp:44:14: note: cannot convert ‘{SHARED_COMPRESSOR, (16 * 1024), 10, ((1 * 1024) * 1024), nullptr, main()::<lambda(std::thread)>::<lambda()>::<lambda(auto:11)>{}, main()::<lambda(std::thread*)>::<lambda()>::<lambda(auto:12*, std::string_view, uWS::OpCode)>{}, main()::<lambda(std::thread*)>::<lambda()>::<lambda(auto:13*)>{}, main()::<lambda(std::thread*)>::<lambda()>::<lambda(auto:14*, std::string_view)>{}, main()::<lambda(std::thread*)>::<lambda()>::<lambda(auto:15*, std::string_view)>{}, main()::<lambda(std::thread*)>::<lambda()>::<lambda(auto:16*, int, std::string_view)>{}}’ (type ‘’) to type ‘uWS::TemplatedApp::WebSocketBehavior<main()::PerSocketData>&&’
}).listen(9001, [](auto listen_socket) {
^
examples/BroadcastingEchoServer.cpp: In function ‘int main()’:
examples/BroadcastingEchoServer.cpp:64:6: error: no matching function for call to ‘uWS::TemplatedApp::ws<main()::PerSocketData>(const char [3], )’
}).listen(9001, [](auto listen_s) {
^
In file included from examples/BroadcastingEchoServer.cpp:1:
src/App.h:220:20: note: candidate: ‘template uWS::TemplatedApp&& uWS::TemplatedApp::ws(std::__cxx11::string, uWS::TemplatedApp::WebSocketBehavior&&) [with UserData = UserData; bool SSL = true]’
TemplatedApp &&ws(std::string pattern, WebSocketBehavior &&behavior) {
^~
src/App.h:220:20: note: template argument deduction/substitution failed:
examples/BroadcastingEchoServer.cpp:64:6: note: cannot convert ‘{DISABLED, ((16 * 1024) * 1024), 60, ((16 * 1024) * 1024), false, true, false, nullptr, main()::<lambda(auto:11)>{}, main()::<lambda(auto:12, std::string_view, uWS::OpCode)>{app}, main()::<lambda(auto:13*)>{}, main()::<lambda(auto:14*, std::string_view)>{}, main()::<lambda(auto:15*, std::string_view)>{}, main()::<lambda(auto:16*, int, std::string_view)>{}}’ (type ‘’) to type ‘uWS::TemplatedApp::WebSocketBehavior<main()::PerSocketData>&&’
}).listen(9001, [](auto listen_s) {
^
In file included from src/HttpResponse.h:31,
from src/App.h:41,
from examples/ServerName.cpp:1:
src/WebSocket.h: In member function ‘void uWS::WebSocket<, , >::end(int, std::string_view)’:
src/WebSocket.h:178:45: warning: conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
char closePayload[MAX_CLOSE_PAYLOAD + 2];
~~~~~~~~~~~~~~~~~~^~~
examples/UpgradeAsync.cpp: In function ‘int main()’:
examples/UpgradeAsync.cpp:119:6: error: no matching function for call to ‘uWS::TemplatedApp::ws<main()::PerSocketData>(const char [3], )’
}).listen(9001, [](auto listen_socket) {
^
In file included from examples/UpgradeAsync.cpp:2:
src/App.h:220:20: note: candidate: ‘template uWS::TemplatedApp&& uWS::TemplatedApp::ws(std::__cxx11::string, uWS::TemplatedApp::WebSocketBehavior&&) [with UserData = UserData; bool SSL = true]’
TemplatedApp &&ws(std::string pattern, WebSocketBehavior &&behavior) {
^~
src/App.h:220:20: note: template argument deduction/substitution failed:
examples/UpgradeAsync.cpp:119:6: note: cannot convert ‘{SHARED_COMPRESSOR, (16 * 1024), 10, ((1 * 1024) * 1024), main()::<lambda(auto:11, auto:12, auto:13*)>{}, main()::<lambda(auto:14*)>{}, main()::<lambda(auto:15*, std::string_view, uWS::OpCode)>{}, main()::<lambda(auto:16*)>{}, main()::<lambda(auto:17*, std::string_view)>{}, main()::<lambda(auto:18*, std::string_view)>{}, main()::<lambda(auto:19*, int, std::string_view)>{}}’ (type ‘’) to type ‘uWS::TemplatedApp::WebSocketBehavior<main()::PerSocketData>&&’
}).listen(9001, [](auto *listen_socket) {
Beta Was this translation helpful? Give feedback.
All reactions