diff --git a/Code/Network/NetworkAPI/NetworkClient.cpp b/Code/Network/NetworkAPI/NetworkClient.cpp index aed1046f..e99ab502 100644 --- a/Code/Network/NetworkAPI/NetworkClient.cpp +++ b/Code/Network/NetworkAPI/NetworkClient.cpp @@ -49,6 +49,7 @@ struct ClientDataContainer callbackType = NetworkProtocolCallbackType_Unknown; sendPostBox = new PostBox(); connection.SetBlockingMode(false); + connection.InitiateClient(); } ClientDataContainer(IThreadObject* o, unsigned int socket ) :connection(socket), ID(currID++) @@ -56,6 +57,7 @@ struct ClientDataContainer InitWinSock(); callbackType = NetworkProtocolCallbackType_Unknown; sendPostBox = new PostBox(); + connection.InitiateClient(); connection.SetBlockingMode(false); } ~ClientDataContainer() diff --git a/Code/Network/OysterNetworkClient/ClientMain.cpp b/Code/Network/OysterNetworkClient/ClientMain.cpp index 45e59e3a..31e499cc 100644 --- a/Code/Network/OysterNetworkClient/ClientMain.cpp +++ b/Code/Network/OysterNetworkClient/ClientMain.cpp @@ -41,11 +41,12 @@ int main() errorCode = client.Connect(15151, "127.0.0.1"); client.SetRecieverObject(proc, NetworkProtocolCallbackType_Function); - if(errorCode != 0) + if(errorCode != 1) { + printf("%d", errorCode); cout << "FAILED" << endl; } - client.SetRecieverObject(proc, NetworkProtocolCallbackType_Function); + //client.SetRecieverObject(proc, NetworkProtocolCallbackType_Function); cout << "Done" << endl; diff --git a/Code/Network/OysterNetworkClient/ClientMain.cpp.BACKUP.7056.cpp b/Code/Network/OysterNetworkClient/ClientMain.cpp.BACKUP.7056.cpp deleted file mode 100644 index 581f41ad..00000000 --- a/Code/Network/OysterNetworkClient/ClientMain.cpp.BACKUP.7056.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include -#include -#include -#include "../NetworkDependencies/WinsockFunctions.h" -#include "..\NetworkDependencies\Protocols.h" -#include "../NetworkDependencies/OysterByte.h" -#include "../../Misc/ThreadSafeQueue.h" -#include "../NetworkDependencies/ThreadedClient.h" -#include "../../Misc/WinTimer.h" -#include "../../Misc/Utilities.h" -#include "../NetworkAPI/NetworkClient.h" - -#pragma comment(lib, "ws2_32.lib") - -using namespace std; -using namespace Oyster::Network::Protocols; -using namespace Oyster::Network; -using namespace Utility; -using namespace Utility::DynamicMemory; - -void proc(CustomNetProtocol& protocol) -{ - -} - -int main() -{ - int errorCode; - - char msgRecv[255] = "\0"; - - InitWinSock(); - - cout << "Client" << endl; - - //Create Client - NetworkClient client; - - //Connect to server -<<<<<<< HEAD - if(client.Connect(15151, "localhost")) -======= - //errorCode = client->Connect(15151, "193.11.186.101"); - errorCode = client.Connect(15151, "127.0.0.1"); - client.SetRecieverObject(proc, NetworkProtocolCallbackType_Function); - - if(errorCode != 0) ->>>>>>> 9eb8fcba40e4dec4f338cd012ba69bc15d456cc9 - { - cout << "FAILED" << endl; - } - client.SetRecieverObject(proc, NetworkProtocolCallbackType_Function); - - cout << "Done" << endl; - - while(1) - { - - } - - ShutdownWinSock(); - - system("pause"); - return 0; -} \ No newline at end of file diff --git a/Code/Network/OysterNetworkClient/ClientMain.cpp.BASE.7056.cpp b/Code/Network/OysterNetworkClient/ClientMain.cpp.BASE.7056.cpp deleted file mode 100644 index 2b75c92d..00000000 --- a/Code/Network/OysterNetworkClient/ClientMain.cpp.BASE.7056.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include -#include -#include -#include "../NetworkDependencies/WinsockFunctions.h" -#include "..\NetworkDependencies\Protocols.h" -#include "../NetworkDependencies/OysterByte.h" -#include "../../Misc/ThreadSafeQueue.h" -#include "../NetworkDependencies/ThreadedClient.h" -#include "../../Misc/WinTimer.h" -#include "../../Misc/Utilities.h" -#include "../NetworkAPI/NetworkClient.h" - -#pragma comment(lib, "ws2_32.lib") - -using namespace std; -using namespace Oyster::Network::Protocols; -using namespace Oyster::Network; -using namespace Utility; -using namespace Utility::DynamicMemory; - -void chat(ThreadedClient &client); -void PrintOutMessage(ProtocolSet* set); - -void proc(CustomNetProtocol& protocol) -{ - -} - -int main() -{ - int errorCode; - - char msgRecv[255] = "\0"; - - InitWinSock(); - - cout << "Client" << endl; - - //Create Client - NetworkClient client; - - //Connect to server - errorCode = client.Connect(15151, "193.11.186.101"); - client.SetRecieverObject(proc, NetworkProtocolCallbackType_Function); - - if(errorCode != 0) - { - wstring errorTest = GetErrorMessage(errorCode); - wcout << "errorMessage: " << errorTest << endl; - } - - while(1) - { - - } - - ShutdownWinSock(); - - system("pause"); - return 0; -} \ No newline at end of file diff --git a/Code/Network/OysterNetworkClient/ClientMain.cpp.LOCAL.7056.cpp b/Code/Network/OysterNetworkClient/ClientMain.cpp.LOCAL.7056.cpp deleted file mode 100644 index b2f4c4bd..00000000 --- a/Code/Network/OysterNetworkClient/ClientMain.cpp.LOCAL.7056.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include -#include -#include -#include "../NetworkDependencies/WinsockFunctions.h" -#include "..\NetworkDependencies\Protocols.h" -#include "../NetworkDependencies/OysterByte.h" -#include "../../Misc/ThreadSafeQueue.h" -#include "../NetworkDependencies/ThreadedClient.h" -#include "../../Misc/WinTimer.h" -#include "../../Misc/Utilities.h" -#include "../NetworkAPI/NetworkClient.h" - -#pragma comment(lib, "ws2_32.lib") - -using namespace std; -using namespace Oyster::Network::Protocols; -using namespace Oyster::Network; -using namespace Utility; -using namespace Utility::DynamicMemory; - -void proc(CustomNetProtocol& protocol) -{ - -} - -int main() -{ - int errorCode; - - char msgRecv[255] = "\0"; - - InitWinSock(); - - cout << "Client" << endl; - - //Create Client - NetworkClient client; - - //Connect to server - if(client.Connect(15151, "localhost")) - { - cout << "FAILED" << endl; - } - client.SetRecieverObject(proc, NetworkProtocolCallbackType_Function); - - cout << "Done" << endl; - - while(1) - { - - } - - ShutdownWinSock(); - - system("pause"); - return 0; -} \ No newline at end of file diff --git a/Code/Network/OysterNetworkClient/ClientMain.cpp.REMOTE.7056.cpp b/Code/Network/OysterNetworkClient/ClientMain.cpp.REMOTE.7056.cpp deleted file mode 100644 index 2274fb5e..00000000 --- a/Code/Network/OysterNetworkClient/ClientMain.cpp.REMOTE.7056.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include -#include -#include -#include "../NetworkDependencies/WinsockFunctions.h" -#include "..\NetworkDependencies\Protocols.h" -#include "../NetworkDependencies/OysterByte.h" -#include "../../Misc/ThreadSafeQueue.h" -#include "../NetworkDependencies/ThreadedClient.h" -#include "../../Misc/WinTimer.h" -#include "../../Misc/Utilities.h" -#include "../NetworkAPI/NetworkClient.h" - -#pragma comment(lib, "ws2_32.lib") - -using namespace std; -using namespace Oyster::Network::Protocols; -using namespace Oyster::Network; -using namespace Utility; -using namespace Utility::DynamicMemory; - -void chat(ThreadedClient &client); -void PrintOutMessage(ProtocolSet* set); - -void proc(CustomNetProtocol& protocol) -{ - -} - -int main() -{ - int errorCode; - - char msgRecv[255] = "\0"; - - InitWinSock(); - - cout << "Client" << endl; - - //Create Client - NetworkClient client; - - //Connect to server - //errorCode = client->Connect(15151, "193.11.186.101"); - errorCode = client.Connect(15151, "127.0.0.1"); - client.SetRecieverObject(proc, NetworkProtocolCallbackType_Function); - - if(errorCode != 0) - { - wstring errorTest = GetErrorMessage(errorCode); - wcout << "errorMessage: " << errorTest << endl; - } - - while(1) - { - - } - - ShutdownWinSock(); - - system("pause"); - return 0; -} \ No newline at end of file