Last change
on this file since 9 was 2, checked in by Sanahuja Guillaume, 9 years ago |
initial commit flaircore
|
File size:
1.5 KB
|
Line | |
---|
1 | // %flair:license{
|
---|
2 | // This file is part of the Flair framework distributed under the
|
---|
3 | // CECILL-C License, Version 1.0.
|
---|
4 | // %flair:license}
|
---|
5 | /*!
|
---|
6 | * \file UdtSocket.h
|
---|
7 | * \brief Class defining a UDT socket
|
---|
8 | * \author Gildas Bayard, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
9 | * \date 2015/04/21
|
---|
10 | * \version 4.0
|
---|
11 | */
|
---|
12 |
|
---|
13 | #ifndef UDTSOCKET_H
|
---|
14 | #define UDTSOCKET_H
|
---|
15 |
|
---|
16 | typedef int UDTSOCKET;
|
---|
17 |
|
---|
18 | #include <ConnectedSocket.h>
|
---|
19 |
|
---|
20 | namespace flair
|
---|
21 | {
|
---|
22 | namespace core
|
---|
23 | {
|
---|
24 | /*! \class UdtSocket
|
---|
25 | *
|
---|
26 | * \brief Class encapsulating a UDT socket
|
---|
27 | *
|
---|
28 | */
|
---|
29 | class UdtSocket:public ConnectedSocket {
|
---|
30 | public:
|
---|
31 | UdtSocket(const Object* parent,const std::string name,bool blockOnSend=false,bool blockOnReceive=true);
|
---|
32 | ~UdtSocket();
|
---|
33 | void Listen(const unsigned int port,const std::string localAddress="ANY");
|
---|
34 | UdtSocket *Accept(Time timeout); //should throw an exception if not a listening socket
|
---|
35 | bool Connect(const unsigned int port,const std::string distantAddress,Time timeout); // /!\ timeout is ignored
|
---|
36 | ssize_t SendMessage(const char* message,size_t message_len,Time timeout);
|
---|
37 | ssize_t RecvMessage(char* buf,size_t buf_len,Time timeout);
|
---|
38 |
|
---|
39 | uint16_t NetworkToHost16(uint16_t data);
|
---|
40 | uint16_t HostToNetwork16(uint16_t data);
|
---|
41 | uint32_t NetworkToHost32(uint32_t data);
|
---|
42 | uint32_t HostToNetwork32(uint32_t data);
|
---|
43 |
|
---|
44 | private:
|
---|
45 | UDTSOCKET socket;
|
---|
46 | bool blockOnSend;
|
---|
47 | bool blockOnReceive;
|
---|
48 | };
|
---|
49 |
|
---|
50 | } // end namespace core
|
---|
51 | } // end namespace flair
|
---|
52 |
|
---|
53 | #endif // UDTSOCKET_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.