30 fState = oCompleteSend;
43 if (fState == oSendingBuffer) MakeCallBack(
dabc::do_Ok);
44 DOUT1(
"Connection to AQUA broken %s:%d - %d:%s", fServerName.c_str(), fServerPort, err, info.c_str());
48 fState = err!=0 ? oError : oDisconnected;
57 dabc::SocketIOAddon(),
58 dabc::DataOutput(url),
60 fState(oDisconnected),
72 DOUT0(
"Destroy AQUA output");
80 EOUT(
"Did not found OutputTransport on other side worker %s", fWorker.GetName());
95 if (!fLastConnect.Expired(fReconnectTmout))
return false;
97 fLastConnect.GetNow();
100 if (fd < 0)
return false;
104 DOUT1(
"Connect AQUA server %s:%d", fServerName.c_str(), fServerPort);
115 if (fState != oReady)
116 if (ConnectAquaServer()) fState = oReady;
126 if (!ConnectAquaServer()) {
137 EOUT(
"Write_Check at wrong state %d", fState);
146 if (fState != oReady) {
147 EOUT(
"Write_Buffer at wrong state %d", fState);
151 fState = oSendingBuffer;
154 fSendHdr.counter = fBufCounter++;
156 StartNetSend(&fSendHdr,
sizeof(fSendHdr), buf);
163 if (fState == oCompleteSend) {
177 case oCompleteSend:
return 0.001;
virtual unsigned Write_Check()
Check if output can be done.
virtual void OnThreadAssigned()
virtual void OnSocketError(int errnum, const std::string &info)
Generic error handler.
ClientOutput(dabc::Url &url)
virtual unsigned Write_Complete()
Complete writing of the buffer.
virtual void OnRecvCompleted()
Method called when receive operation is completed.
void MakeCallBack(unsigned arg)
virtual double Write_Timeout()
Timeout in seconds for write operation.
virtual double ProcessTimeout(double lastdiff)
virtual bool Write_Init()
This is generic virtual method to initialize output before real work is started.
virtual unsigned Write_Buffer(dabc::Buffer &buf)
Start writing of buffer to output.
virtual void OnSendCompleted()
Method called when send operation is completed.
Reference on memory from memory pool.
BufferSize_t GetTotalSize() const
Return total size of all buffer segments.
Represents command with its arguments.
Base class for output transport implementations.
void Write_CallBack(unsigned arg)
static int StartClient(const std::string &host, int nport, bool nonblocking=true)
Uniform Resource Locator interpreter.
int GetOptionInt(const std::string &optname, int dflt=0) const
std::string GetHostName() const