/***************************************************************************
                          tcp.h  -  description
                             -------------------
    begin                : Sat Dec 6 2003
    copyright            : (C) 2003 by Wei Zheng
    email                : v_zheng@yahoo.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef TCP_H
#define TCP_H

#include <net.h>
#include <semaphore.h>
#include "onlineusers.h"

extern onlineusers usersqueue;

/**
  *@author Wei Zheng
  */

class tcp : public net {
public: 
	tcp();
	~tcp();

public:
  int counter;
  char mesg[MESGSIZE];
  char tmpline[256];
  char finline[256];
  sem_t bin_sem;
  userinfo * userinfop;
  int pipefd[2];

public:
  /** reci mesg */
  int reci_mesg(int length);
  /** send mesg */
  int send_mesg(char * ready_mesg, int len);

};

#endif
