Source: ClientSocket.h


Annotated List
Files
Globals
Hierarchy
Index
/***************************************************************************
 *
 * File:    ClientSocket.h
 * Created: Sat Dec 4 1999
 * (C) 1999 by David M. <captjay@superlink.net>
 *
 ***************************************************************************/
/***************************************************************************
 *                                                                         *
 *   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 CLIENTSOCKET_H
#define CLIENTSOCKET_H

#include "Socket.h"
#include <qstring.h>

/**
* @author David M.
* @short Socket subclass that allows client-style connections.
* Socket subclass that defines a connectTo method to allow client-style connections.
* @see Socket
* @see ServerSocket
*/
class ClientSocket : public Socket
{
  public:

// Constructors
  ClientSocket();
  /**
  * Initialize a ClientSocket object and connect to the specified host/port.
  * You must manually check isConnected() when using this constructor, since there is no way to
  * check if the connection was accepted or rejected.
  * @param host Hostname or IP address of the machine to connect to.
  * @param prt TCP port on which to attempt a connection.
  */
  ClientSocket(const QString& host, const int port);
  /**
  * Initialize a ClientSocket object and connect to the specified host/port.
  * You must manually check isConnected() when using this constructor, since there is no way to
  * check if the connection was accepted or rejected.
  * @param host Hostname or IP address of the machine to connect to.
  * @param prt TCP port on which to attempt a connection.
  */
  ClientSocket(const char* host, const int port);
// Destructor
  ~ClientSocket();
  
// Public functions
  /**
  * Attempt a connection to the specified host/port.
  *
  * PRECONDITIONS: !isConnected()
  * @param host Hostname or IP address of the machine to connect to.
  * @param prt TCP port on which to attempt a connection.
  * @return true if the connection was established, false if an error occured.
  */
  bool connectTo(const QString& host, const int port);
  /**
  * Attempt a connection to the specified host/port.
  *
  * PRECONDITIONS: !isConnected()
  * @param host Hostname or IP address of the machine to connect to.
  * @param prt TCP port on which to attempt a connection.
  * @return true if the connection was established, false if an error occured.
  */
  bool connectTo(const char* host, const int port);
};

#endif
















Generated by: nightsky@centauri on Sat Jan 15 23:06:10 2000, using kdoc 2.0a30.