18 #include <sys/types.h>
37 if (classname ==
"SocketCommandChannel") {
41 if (cmd.
GetBool(
"WithServer",
true)) {
42 std::string host = cmd.
GetStr(
"ServerHost");
43 int nport = cmd.
GetInt(
"ServerPort");
48 EOUT(
"Cannot open cmd socket on port %d", nport);
65 const std::string &devname,
Command cmd)
91 if (fhandle<0)
return 0;
Represents command with its arguments.
bool SetStr(const std::string &name, const char *value)
std::string GetStr(const std::string &name, const std::string &dflt="") const
bool GetBool(const std::string &name, bool dflt=false) const
int GetInt(const std::string &name, int dflt=0) const
Base class for device implementation.
virtual Module * CreateTransport(const Reference &port, const std::string &typ, Command cmd)
Factory method to create transport.
Base for dabc::ModuleSync and dabc::ModuleAsync classes.
Reference on the dabc::Port class
bool IsOutput() const
Returns true if it is output port.
Reference on the arbitrary object
bool null() const
Returns true if reference contains nullptr.
void SetDeliverEventsToWorker(bool on=true)
Provides command channel to the dabc process.
Device for establishing socket connections
virtual Reference CreateObject(const std::string &classname, const std::string &objname, Command cmd)
Factory method to create object.
virtual Reference CreateThread(Reference parent, const std::string &classname, const std::string &thrdname, const std::string &thrddev, Command cmd)
Factory method to create thread.
virtual Module * CreateTransport(const Reference &port, const std::string &typ, Command cmd)
Factory method to create transport.
virtual Device * CreateDevice(const std::string &classname, const std::string &devname, Command cmd)
Factory method to create device.
virtual void Initialize()
Method called by the manager during application start.
void SetSendAddr(const std::string &host="", int port=0)
Set destination address for all send operations,.
Specific implementation of network transport for socket.
void SetMCastAddr(const std::string addr)
Set mcast address, required to correctly close socket.
Socket addon for handling connection requests on server side.
Special thread class for handling sockets.
static void CloseUdp(int fd)
Close datagram (udp) socket.
static int CreateUdp()
Create datagram (udp) socket.
static bool AttachMulticast(int handle, const std::string &addr)
Attach datagram socket to multicast group to make receiving.
static int BindUdp(int fd, int nport, int portmin=-1, int portmax=-1)
Bind UDP socket to specified port.
static SocketServerAddon * CreateServerAddon(const std::string &host, int nport, int portmin=-1, int portmax=-1)
Create handle for server-side connection If hostname == 0, any available address will be selected If ...
Represent thread functionality.
Uniform Resource Locator interpreter.
bool HasOption(const std::string &optname) const
std::string GetHostName() const
std::string GetProtocol() const
const char * typeSocketThread
const char * typeSocketDevice