Last change
on this file since 5897 was 5614, checked in by mies, 15 years ago |
added termination of transports when no link is up anymore to an end-point
|
File size:
1.0 KB
|
Rev | Line | |
---|
[5284] | 1 | #ifndef TCPIP_HPP_
|
---|
| 2 | #define TCPIP_HPP_
|
---|
| 3 |
|
---|
| 4 | #include "../transport.hpp"
|
---|
| 5 | #include <pthread.h>
|
---|
| 6 |
|
---|
| 7 | // forward declaration
|
---|
| 8 | namespace protlib {
|
---|
| 9 | template<class X, class Y>
|
---|
| 10 | class ThreadStarter;
|
---|
| 11 | class TPoverTCP;
|
---|
| 12 | class TPoverTCPParam;
|
---|
| 13 | }
|
---|
| 14 |
|
---|
| 15 | namespace ariba {
|
---|
| 16 | namespace transport {
|
---|
| 17 |
|
---|
| 18 | using namespace protlib;
|
---|
| 19 |
|
---|
| 20 | /**
|
---|
| 21 | * TODO: Doc
|
---|
| 22 | *
|
---|
| 23 | * @author Sebastian Mies <mies@tm.uka.de>
|
---|
| 24 | */
|
---|
| 25 | class tcpip : public transport_protocol {
|
---|
| 26 | public:
|
---|
| 27 | tcpip( uint16_t port );
|
---|
| 28 | virtual ~tcpip();
|
---|
| 29 | virtual void start();
|
---|
| 30 | virtual void stop();
|
---|
| 31 | virtual void send( const address_v* remote, const uint8_t* data, size_t size );
|
---|
| 32 | virtual void send( const endpoint_set& endpoints, const uint8_t* data, size_t size );
|
---|
[5614] | 33 | virtual void terminate( const address_v* remote );
|
---|
[5284] | 34 | virtual void register_listener( transport_listener* listener );
|
---|
| 35 |
|
---|
| 36 | private:
|
---|
| 37 | volatile bool done, running;
|
---|
| 38 | uint16_t port;
|
---|
| 39 | pthread_t tpreceivethread;
|
---|
| 40 | ThreadStarter<TPoverTCP, TPoverTCPParam>* tpthread;
|
---|
| 41 | static void* receiverThread( void* ptp );
|
---|
| 42 | transport_listener* listener;
|
---|
| 43 | };
|
---|
| 44 |
|
---|
| 45 | }} // namespace ariba::transport
|
---|
| 46 |
|
---|
| 47 | #endif /* TCPIP_HPP_ */
|
---|
Note:
See
TracBrowser
for help on using the repository browser.