PadicoTM

Documentation

« back to PM2 home.
HelloSOAP-server.c
Go to the documentation of this file.
1
9#include <Padico/Puk.h>
10#include <Padico/PadicoTM.h>
11#include <Padico/PM2.h>
12#include <Padico/NetAccess.h>
13#include <Padico/Module.h>
14
15#include <stdsoap2.h>
16
17#include "soapH.h"
18#include "HelloSOAP.nsmap"
19
20#define SOAP_DEFAULT_PORT 18084
21
22static struct soap soap;
23
24static int hello_soap_init(void);
25static void hello_soap_stop(void);
26
28
29/* ********************************************************* */
30
31int HelloSOAP__SayHello(struct soap *soap, char**out)
32{
33 padico_print("Hello world from SOAP!\n");
34 out = NULL;
35 return 0;
36}
37
38/* ********************************************************* */
39
40static int hello_soap_start(void)
41{
42 int rc = 0;
43 int m;
45
46 padico_trace("creating HelloSOAP server on port %d\n", soap_port);
48 m = soap_bind(&soap, NULL, soap_port, 100);
49 if (m < 0)
50 {
52 rc = -1;
53 }
54 else
55 {
56 padico_print("URL=http://%s:%d/HelloSOAP\n",
58 }
59 return rc;
60}
61
62static void* hello_soap_worker(void*dummy)
63{
64 int s;
65 padico_trace("starting HelloSOAP server\n");
66 for ( ; ; )
67 {
68 s = soap_accept(&soap);
69 padico_trace("Socket connection successful: slave socket = %d\n", s);
70 if (s < 0)
71 {
73 }
74 else
75 {
77 soap_end(&soap);
78 }
79 }
80 return NULL;
81}
82
83/* **** module entry points ******************************** */
84
86
87static int hello_soap_init(void)
88{
89 int rc;
91 if(!rc)
92 {
94 }
95 return rc;
96}
97
98static void hello_soap_stop(void)
99{
100 padico_trace("stop %s\n", padico_topo_nodename());
103 /* TODO: actually kill the thread. */
104}
static pthread_t hello_soap_tid
static int hello_soap_init(void)
#define SOAP_DEFAULT_PORT
int HelloSOAP__SayHello(struct soap *soap, char **out)
static void * hello_soap_worker(void *dummy)
static void hello_soap_stop(void)
static struct soap soap
static int hello_soap_start(void)
return NULL
Definition Shm.h:88
uintptr_t s
Definition Shm.h:88
static int soap_port
Definition bench_SOAP.c:29
static int done
Definition console-mod.c:49
padico_rc_t rc
Definition PadicoTM.h:146
#define padico_topo_nodename()
Definition Topology.h:317
#define padico_topo_getlocalhost()
Definition Topology.h:319
const char * padico_topo_host_getname(padico_topo_host_t host)
Get the canonical name of a host.
Definition topology.c:1944