www.pudn.com > Ftpwork > MyThread.h


/***************************************************************************
                          MyThread.h  -  description
                             -------------------
    begin                : Wed Nov 6 2002
    copyright            : (C) 2002 by 
    email                : 
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/
#include 

struct Input{
    int SockID;
};

Input Parameter;
char Flag;


void *thread(void *)
{
  int SockID=Parameter.SockID;
  //cout<SockID=SockID;
  state->Validate[0]=FALSE;
  sprintf(state->Path,"%s",RootPath);

  while (1){
       len=MyRecv( SockID, buf, MAX_LINE, 0 , SockState);
       if(*SockState<1)break;
       if (len>=1){
         //fputs(buf,stdout);
         //cout<<"\n";
         if( Handle( buf, len, state )== FALSE )break;
        }

  }

  delete state;
  close(SockID);
  int *a;
  return a;
}