Esempio n. 1
0
void *thread_main(void *info_stack)
{
  try
  {
    Socket client; //for the input connection from the client
    Proxy p;
    new_conn_info peerinfo;

    //read a new peerinfo from the stack
    pthread_mutex_lock(&info_stack_mutex);
    peerinfo=((stack<new_conn_info>*)info_stack)->top();
    ((stack<new_conn_info>*)info_stack)->pop();
    pthread_mutex_unlock(&info_stack_mutex);

    connection_id=peerinfo.connection_id;
    client.setFD(peerinfo.new_fd);
    p.setOutside(client);
    p.run(peerinfo.peer_address);
    remove_child_from_childlist(connection_id);
  }
  catch(Exception &e)
  {
    LDEB(e);
  }
  return NULL;
}