9 #ifndef __SHAWN_APPS_TCPIP_SOCKET_H
10 #define __SHAWN_APPS_TCPIP_SOCKET_H
13 #include <shawn_config.h>
14 #include "_apps_enable_cmake.h"
27 #include <apps/tcpip/storage.h>
34 {
class SimulationController; }
37 extern "C" void init_tcpip( shawn::SimulationController& );
42 #pragma warning( disable : 4290 )
70 virtual const char*
what()
const throw()
95 void accept() throw( SocketException );
97 void send( const std::
vector<
unsigned char> &buffer) throw( SocketException );
100 std::
vector<
unsigned char>
receive(
int bufSize = 2048 ) throw( SocketException );
118 void receiveComplete(
unsigned char *
const buffer, std::size_t len)
const;
120 size_t recvAndCheck(
unsigned char *
const buffer, std::size_t len)
const;
122 void printBufferOnVerbose(
const std::vector<unsigned char> buffer,
const std::string &label)
const;
128 std::string GetWinsockErrorString(
int err)
const;
130 bool atoaddr(std::string,
struct in_addr& addr);
141 static bool init_windows_sockets_;
142 static bool windows_sockets_initialized_;
143 static int instance_count_;
149 #endif // BUILD_TCPIP