Ejemplo n.º 1
0
 virtual int run()
 {
     char buf[2049];
     int readlen = 0;
     do
     {
         readlen = recv(m_r->OShandle(), buf, 2048, 0);
         if(readlen > 0)
         {
             buf[readlen] = 0;
             m_w->write(buf, readlen);
             // make it not to log unless it's REALLY needed.
             if(http_tracelevel >= 20 && m_ofile != NULL)
             {
                 fprintf(m_ofile, "%s", buf);
             }
         }
         else 
         {
             m_w->shutdown();
             m_w->close();
             break;
         }
     }
     while(true);
     return 0;
 }
Ejemplo n.º 2
0
void CThorTransferGroup::send(SocketEndpoint &ep, CThorRowArray & group)
{
    ISocket * sendSkt = ISocket::connect_wait(ep, 360*120*1000); // give it plenty of time, sequential in nature *could* be delayed in other side listening
    sendSkt->set_block_mode(BF_SYNC_TRANSFER_PULL,0,TRANSFER_TIMEOUT);
    MemoryBuffer mb;
    group.serialize(serializer,mb,false);
    sendSkt->send_block(mb.toByteArray(),mb.length());
    sendSkt->close();
    sendSkt->Release();
}
Ejemplo n.º 3
0
 virtual void Unbind()
 {
     if (serversock) {
         ISocket *sock = serversock;
         serversock = NULL;
         try {
             sock->close();
         }
         catch (IJSOCK_Exception *) {
             sock->Release();
             throw; // TBD
         }
         sock->Release();
     }
 }
Ejemplo n.º 4
0
 virtual int run()
 {
     char buf[2049];
     int readlen = 0;
     do
     {
         readlen = recv(m_r->OShandle(), buf, 2048, 0);
         if(readlen > 0)
         {
             buf[readlen] = 0;
             m_w->write(buf, readlen);
         }
         else
         {
             m_w->shutdown();
             m_w->close();
             break;
         }
     }
     while(true);
     return 0;
 }