otsdaq
v2_05_02_indev
Return to top level
Main Page
Classes
Files
File List
TransmitterSocket.h
1
#ifndef _ots_TransmitterSocket_h_
2
#define _ots_TransmitterSocket_h_
3
4
#include "otsdaq/NetworkUtilities/Socket.h"
5
6
#include <mutex>
//for std::mutex
7
#include <string>
8
#include <vector>
9
10
namespace
ots
11
{
12
class
TransmitterSocket
:
public
virtual
Socket
13
{
14
// TransceiverSocket is a "Friend" class of TransmitterSocket so has access to private
15
// members.
16
friend
class
TransceiverSocket
;
17
18
public
:
19
TransmitterSocket
(
const
std::string& IPAddress,
unsigned
int
port = 0);
20
virtual
~
TransmitterSocket
(
void
);
21
22
int
send(
Socket
& toSocket,
const
std::string& buffer,
bool
verbose =
false
);
23
int
send(
Socket
& toSocket,
const
std::vector<uint32_t>& buffer,
bool
verbose =
false
);
24
int
send(
Socket
& toSocket,
const
std::vector<uint16_t>& buffer,
bool
verbose =
false
);
25
26
protected
:
27
TransmitterSocket
(
void
);
28
29
private
:
30
std::mutex sendMutex_;
// to make transmitter socket thread safe
31
// i.e. multiple threads can share a socket and call send()
32
};
33
34
}
// namespace ots
35
36
#endif
ots::Socket
Definition:
Socket.h:10
ots::TransceiverSocket
Definition:
TransceiverSocket.h:11
ots::TransmitterSocket
Definition:
TransmitterSocket.h:12
otsdaq
otsdaq
NetworkUtilities
TransmitterSocket.h
Generated on Wed Apr 29 2020 18:41:48 for otsdaq by
1.8.5