cpp utils files, network and a smal util class

This commit is contained in:
Ziver Koc 2009-11-21 01:11:05 +00:00
parent ea3dffdb4a
commit 62f50a2f79
13 changed files with 610 additions and 0 deletions

24
net/test_client.cpp Normal file
View file

@ -0,0 +1,24 @@
#include <iostream>
#include <string>
#include "socket.h"
#include "socketexception.h"
using namespace std;
int main ( int argc, int argv[] ){
try{
Socket socket ( "localhost", 30000 );
std::string reply;
try{
socket << "Test message.";
socket >> reply;
}
catch ( SocketException& ) {}
cout << "We received this response from the server:\n\"" << reply << "\"\n";
}catch ( SocketException& e ){
cout << "Exception was caught:" << e.description() << "\n";
}
return 0;
}