34 if (!fMcastAddr.empty())
37 delete [] fHeaders; fHeaders = 0;
45 for (uint32_t n=0;n<tr->
NumRecs();n++)
52 fSendQueue.Allocate(fulloutputqueue);
53 fRecvQueue.Allocate(fullinputqueue);
55 DOUT5(
"Create queues inp: %d out: %d", fullinputqueue, fulloutputqueue);
61 if (cmd ==
"GetNetworkTransportInetrface")
return (
long) ((
NetworkInetrface*)
this);
69 fSendQueue.Push(recid);
72 if ((fSendQueue.Size()==1) && (fSendStatus==0)) OnSendCompleted();
79 fRecvQueue.Push(recid);
82 if ((fRecvQueue.Size()==1) && (fRecvStatus==0)) OnRecvCompleted();
90 else EOUT(
"Socket msg without transport %d %s", msg, info.c_str());
99 EOUT(
"Transport not available!!!");
105 if (fSendStatus==1) {
112 if (fSendQueue.Size() == 0)
return;
114 fSendRecid = fSendQueue.Pop();
121 EOUT(
"record %u failed", fSendRecid);
128 EOUT(
"Completely wrong send recid %u", fSendRecid);
148 EOUT(
"Transport not available!!!");
154 if (fRecvStatus==2) {
162 if (fRecvStatus==1) {
170 EOUT(
"Completely wrong recv rec id %u", fRecvRecid);
177 DOUT1(
"Receive buffer with EOL bufsize = %u resthdr = %u",
186 EOUT(
"Fatal - no buffer to receive data rec %d sz1:%d sz2:%d",
193 if (!StartRecv(rec->
buf, nethdr->
size)) {
194 EOUT(
"Cannot start recv - fatal error");
202 if (fRecvQueue.Size() == 0)
return;
203 fRecvRecid = fRecvQueue.Pop();
208 EOUT(
"Completely wrong recv recid %u", fRecvRecid);
214 if (IsDatagramSocket()) {
BufferSize_t GetTotalSize() const
Return total size of all buffer segments.
void SetRecHeader(uint32_t recid, void *header)
NetIORec * GetRec(unsigned id) const
unsigned GetFullHeaderSize() const
void ProcessRecvCompl(uint32_t recid)
void ProcessSendCompl(uint32_t recid)
int PackHeader(uint32_t recid)
Socket addon for handling I/O events.
virtual void OnSendCompleted()
Method called when send operation is completed.
virtual void AllocateNet(unsigned fulloutputqueue, unsigned fullinputqueue)
virtual void SubmitRecv(uint32_t recid)
SocketNetworkInetrface(int fd, bool datagram=false)
virtual ~SocketNetworkInetrface()
virtual long Notify(const std::string &, int)
Light-weight command interface, which can be used from worker.
virtual void OnSocketError(int msg, const std::string &info)
Generic error handler.
virtual void SubmitSend(uint32_t recid)
virtual void OnRecvCompleted()
Method called when receive operation is completed.
static void DettachMulticast(int handle, const std::string &addr)
Detach datagram socket from multicast group.
virtual void CloseTransport(bool witherr=false)
virtual long Notify(const std::string &, int)
Light-weight command interface, which can be used from worker.