TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
TCSoap.h File Reference
#include "Define.h"
#include <mutex>
#include <future>
#include <string>
+ Include dependency graph for TCSoap.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  SOAPCommand
 

Functions

void process_message (struct soap *soap_message)
 
void TCSoapThread (const std::string &host, uint16 port)
 

Function Documentation

void process_message ( struct soap soap_message)
58 {
59  TC_LOG_TRACE("network.soap", "SOAPWorkingThread::process_message");
60 
61  soap_serve(soap_message);
62  soap_destroy(soap_message); // dealloc C++ data
63  soap_end(soap_message); // dealloc data and clean up
64  soap_done(soap_message); // detach soap struct
65  free(soap_message);
66 }
#define soap_destroy(soap)
Definition: stdsoap2.h:2295
SOAP_FMAC1 void SOAP_FMAC2 soap_done(struct soap *soap)
Definition: stdsoap2.cpp:5181
#define TC_LOG_TRACE(filterType__,...)
Definition: Log.h:195
SOAP_FMAC1 void SOAP_FMAC2 soap_end(struct soap *soap)
Definition: stdsoap2.cpp:9279
SOAP_FMAC5 int SOAP_FMAC6 soap_serve(struct soap *soap)
Definition: soapServer.cpp:20

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void TCSoapThread ( const std::string &  host,
uint16  port 
)
26 {
27  struct soap soap;
28  soap_init(&soap);
31 
32  // check every 3 seconds if world ended
33  soap.accept_timeout = 3;
34  soap.recv_timeout = 5;
35  soap.send_timeout = 5;
36  if (!soap_valid_socket(soap_bind(&soap, host.c_str(), port, 100)))
37  {
38  TC_LOG_ERROR("network.soap", "Couldn't bind to %s:%d", host.c_str(), port);
39  exit(-1);
40  }
41 
42  TC_LOG_INFO("network.soap", "Bound to http://%s:%d", host.c_str(), port);
43 
44  while (!World::IsStopped())
45  {
47  continue; // ran into an accept timeout
48 
49  TC_LOG_DEBUG("network.soap", "Accepted connection from IP=%d.%d.%d.%d", (int)(soap.ip>>24)&0xFF, (int)(soap.ip>>16)&0xFF, (int)(soap.ip>>8)&0xFF, (int)soap.ip&0xFF);
50  struct soap* thread_soap = soap_copy(&soap);// make a safe copy
51  process_message(thread_soap);
52  }
53 
54  soap_done(&soap);
55 }
unsigned long ip
Definition: stdsoap2.h:2097
#define SOAP_C_UTFSTRING
Definition: stdsoap2.h:1375
#define soap_valid_socket(n)
Definition: stdsoap2.h:859
Definition: stdsoap2.h:1933
SOAP_FMAC1 SOAP_SOCKET SOAP_FMAC2 soap_accept(struct soap *soap)
Definition: stdsoap2.cpp:4971
int accept_timeout
Definition: stdsoap2.h:1950
SOAP_FMAC1 SOAP_SOCKET SOAP_FMAC2 soap_bind(struct soap *soap, const char *host, int port, int backlog)
Definition: stdsoap2.cpp:4743
static bool IsStopped()
Definition: World.h:663
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
#define soap_set_omode(soap, n)
Definition: stdsoap2.h:2291
#define soap_set_imode(soap, n)
Definition: stdsoap2.h:2289
SOAP_FMAC1 void SOAP_FMAC2 soap_done(struct soap *soap)
Definition: stdsoap2.cpp:5181
char host[SOAP_TAGLEN]
Definition: stdsoap2.h:2094
SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_copy(const struct soap *soap)
Definition: stdsoap2.cpp:8660
int send_timeout
Definition: stdsoap2.h:1948
void process_message(struct soap *soap_message)
Definition: TCSoap.cpp:57
#define soap_init(soap)
Definition: stdsoap2.h:2275
int recv_timeout
Definition: stdsoap2.h:1947
int port
Definition: stdsoap2.h:2098
#define TC_LOG_INFO(filterType__,...)
Definition: Log.h:201
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the call graph for this function:

+ Here is the caller graph for this function: