diff --git a/components/net/cpp/include/ftl/net/ws_internal.hpp b/components/net/cpp/include/ftl/net/ws_internal.hpp index 5390f10281c860f91d35e3adf71d1101c1a0b275..ea0471a8882ae5419232ac37c5aae61c7042030a 100644 --- a/components/net/cpp/include/ftl/net/ws_internal.hpp +++ b/components/net/cpp/include/ftl/net/ws_internal.hpp @@ -6,6 +6,8 @@ #include <functional> #include <ftl/uri.hpp> +#include <ftl/net/common.hpp> + using std::size_t; namespace ftl { @@ -44,7 +46,7 @@ int ws_dispatch(const char *data, size_t len, std::function<void(const wsheader_ */ int ws_prepare(wsheader_type::opcode_type, bool useMask, size_t len, char *buffer, size_t maxlen); -bool ws_connect(int sockfd, const ftl::URI &uri); +bool ws_connect(SOCKET sockfd, const ftl::URI &uri); }; }; diff --git a/components/net/cpp/src/ws_internal.cpp b/components/net/cpp/src/ws_internal.cpp index e8387d93927f186c1c4b3e6d92870bde35aec4cd..a58a47d7746f34bbfe4dc057dd3514473d029cb7 100644 --- a/components/net/cpp/src/ws_internal.cpp +++ b/components/net/cpp/src/ws_internal.cpp @@ -5,8 +5,6 @@ //#define GLOG_NO_ABBREVIATED_SEVERITIES #include <loguru.hpp> -#include <ftl/net/common.hpp> - #include <cstring> #include <ftl/net/ws_internal.hpp> #include <memory> diff --git a/components/net/cpp/test/peer_unit.cpp b/components/net/cpp/test/peer_unit.cpp index 583f615d4b9c77735342972116bb15a3bac461fb..dd780cbc4f5d20c17d012da3a36c4341da6e90a2 100644 --- a/components/net/cpp/test/peer_unit.cpp +++ b/components/net/cpp/test/peer_unit.cpp @@ -34,7 +34,7 @@ using std::chrono::milliseconds; class MockPeer : public Peer { public: - MockPeer() : Peer(0) {} + MockPeer() : Peer(INVALID_SOCKET) {} void mock_data() { data(); } }; @@ -45,7 +45,7 @@ static std::map<int, std::string> fakedata; #ifdef WIN32 int ftl::net::internal::recv(SOCKET sd, char *buf, int n, int f) { #else -ssize_t ftl::net::internal::recv(int sd, void *buf, size_t n, int f) { +ssize_t ftl::net::internal::recv(SOCKET sd, void *buf, size_t n, int f) { #endif if (fakedata.count(sd) == 0) { std::cout << "Unrecognised socket" << std::endl;