connectiontcpserver.h
/*
Copyright (c) 2007-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 CONNECTIONTCPSERVER_H__
#define CONNECTIONTCPSERVER_H__
#include "gloox.h"
#include "connectiontcpbase.h"
#include "logsink.h"
#include <string>
namespace gloox
{
class ConnectionHandler;
class GLOOX_API ConnectionTCPServer : public ConnectionTCPBase
{
public:
ConnectionTCPServer( ConnectionHandler* ch, const LogSink& logInstance,
const std::string& ip, int port );
virtual ~ConnectionTCPServer();
// reimplemented from ConnectionBase
virtual ConnectionError recv( int timeout = -1 );
// reimplemented from ConnectionBase
virtual ConnectionError connect();
// reimplemented from ConnectionBase
virtual ConnectionBase* newInstance() const;
private:
ConnectionTCPServer &operator=( const ConnectionTCPServer & );
ConnectionHandler* m_connectionHandler;
};
}
#endif // CONNECTIONTCPSERVER_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::ConnectionHandler
This is an abstract base class to receive incoming connection attempts. Do not confuse this with Conn...
Definition connectionhandler.h:34
gloox::ConnectionTCPBase::ConnectionTCPBase
ConnectionTCPBase(const LogSink &logInstance, const std::string &server, int port=-1)
Definition connectiontcpbase.cpp:53
gloox::ConnectionTCPServer::ConnectionTCPServer
ConnectionTCPServer(ConnectionHandler *ch, const LogSink &logInstance, const std::string &ip, int port)
Definition connectiontcpserver.cpp:69
gloox::ConnectionTCPServer::recv
virtual ConnectionError recv(int timeout=-1)
Definition connectiontcpserver.cpp:176
gloox::ConnectionTCPServer::newInstance
virtual ConnectionBase * newInstance() const
Definition connectiontcpserver.cpp:80
gloox::ConnectionTCPServer::connect
virtual ConnectionError connect()
Definition connectiontcpserver.cpp:85
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