connectiontcpclient.h
/*
Copyright (c) 2004-2023 by Jakob Schröter <js@camaya.net>
This file is part of the gloox library. http://camaya.net/gloox
This software is distributed under a license. The full license
agreement can be found in the file LICENSE in this distribution.
This software may not be copied, modified, sold or distributed
other than expressed in the named license agreement.
This software is distributed without any warranty.
*/
#ifndef CONNECTIONTCPCLIENT_H__
#define CONNECTIONTCPCLIENT_H__
#include "gloox.h"
#include "connectiontcpbase.h"
#include "logsink.h"
#include <string>
namespace gloox
{
class GLOOX_API ConnectionTCPClient : public ConnectionTCPBase
{
public:
ConnectionTCPClient( const LogSink& logInstance, const std::string& server, int port = -1 );
ConnectionTCPClient( ConnectionDataHandler* cdh, const LogSink& logInstance,
const std::string& server, int port = -1 );
virtual ~ConnectionTCPClient();
// reimplemented from ConnectionBase
virtual ConnectionError recv( int timeout = -1 );
// reimplemented from ConnectionBase
virtual ConnectionError connect();
// reimplemented from ConnectionBase
virtual ConnectionBase* newInstance() const;
private:
ConnectionTCPClient &operator=( const ConnectionTCPClient & );
};
}
#endif // CONNECTIONTCPCLIENT_H__
gloox::ConnectionBase
An abstract base class for a connection.
Definition connectionbase.h:35
gloox::ConnectionBase::port
int port() const
Definition connectionbase.h:121
gloox::ConnectionBase::server
const std::string & server() const
Definition connectionbase.h:115
gloox::ConnectionDataHandler
This is an abstract base class to receive events from a ConnectionBase-derived object.
Definition connectiondatahandler.h:36
gloox::ConnectionTCPBase::ConnectionTCPBase
ConnectionTCPBase(const LogSink &logInstance, const std::string &server, int port=-1)
Definition connectiontcpbase.cpp:53
gloox::ConnectionTCPClient::recv
virtual ConnectionError recv(int timeout=-1)
Definition connectiontcpclient.cpp:125
gloox::ConnectionTCPClient::newInstance
virtual ConnectionBase * newInstance() const
Definition connectiontcpclient.cpp:62
gloox::ConnectionTCPClient::connect
virtual ConnectionError connect()
Definition connectiontcpclient.cpp:67
gloox::ConnectionTCPClient::ConnectionTCPClient
ConnectionTCPClient(const LogSink &logInstance, const std::string &server, int port=-1)
Definition connectiontcpclient.cpp:45
gloox::LogSink
An implementation of log sink and source.
Definition logsink.h:39
gloox
The namespace for the gloox library.
Definition adhoc.cpp:28
gloox::ConnectionError
ConnectionError
Definition gloox.h:684