Socket Factory has only one function which works for server and client code, and can do tls for both

This commit is contained in:
Benjamin Sergeant
2019-09-30 22:06:46 -07:00
parent 1ed39677ce
commit 22b4e6a8fb
18 changed files with 39 additions and 48 deletions

View File

@ -11,6 +11,7 @@
#include <iostream>
#include <ixwebsocket/IXSocket.h>
#include <ixwebsocket/IXSocketFactory.h>
#include <ixwebsocket/IXSocketTLSOptions.h>
#include <sstream>
#include <vector>
@ -20,7 +21,8 @@ namespace ix
{
bool tls = false;
std::string errorMsg;
_socket = createSocket(tls, errorMsg);
SocketTLSOptions tlsOptions;
_socket = createSocket(tls, -1, errorMsg, tlsOptions);
if (!_socket)
{