/***************************************************************************
                          svdrpc.h  -  description
                             -------------------
    begin                : Sat Aug  5 13:32:09 MEST 2000
    copyright            : (C) 2000 by Guido
    email                : gfiala@s.netic.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 __SVDRPC_H
#define __SVDRPC_H

//#define _GNU_SOURCE

#define MAXCMDBUFFER 256

class cSocket {
private:
  int port;
  int sock;
  int queue;
public:
  ~cSocket();
  bool Open(int Port);
  int Connect(void);
  void Close(void);
};

class cSVDRPC {
public:
  ~cSVDRPC();
  bool Connected();
  bool CmdQuit();
  bool CmdTKey(const char *key);
  const char* CmdChan();
  char name[22];
  void Open(int Port);
  void Close(void);
private:
  cSocket socket;
  int  filedes;
  int port;
  bool Send(const char *s, int length = -1);
  bool ReadReply();
  char buf[MAXCMDBUFFER];
  int  outstandingReply;
};

#endif //__SVDRP_H
