- rcf.zip
- RCF
- demo
- vs2003
- RCF
- doc
- include
- RCF
- SF
- license.txt
- src
- RCF
- SF
- test
- vs2003
- RCF
- RCF.sln
- RCF
- RCF.vcproj
- RCFTest
- RCFTest.vcproj
|
//*****************************************************************************
// RCF - Remote Call Framework
// Copyright (c) 2005. All rights reserved.
// Developed by Jarl Lindrud.
// Contact: jlindrud@hotmail.com .
//*****************************************************************************
#include <RCF/Multiplexer.hpp>
namespace RCF {
// ClientInfo
ClientInfo::ClientInfo()
{}
ClientInfo::ClientInfo(const sockaddr_in &addr) :
addr(addr),
ip(inet_ntoa(addr.sin_addr))
{}
std::string ClientInfo::getAddress() const
{
return ip;
}
sockaddr_in ClientInfo::getSockAddr() const
{
return addr;
}
// SessionInfo
Platform::Threads::thread_specific_ptr<SessionInfo *>::Val ppCurrentSessionInfo;
SessionInfo::SessionInfo() :
fd(-1),
clientInfo(),
reservedForForwarding(),
forwardFd(-1)
{}
SessionInfo::SessionInfo(int fd) :
fd(fd),
clientInfo(),
reservedForForwarding(),
forwardFd(-1)
{}
int SessionInfo::getFd() const
{
return fd;
}
const ClientInfo &SessionInfo::getClientInfo() const
{
return clientInfo;
}
bool SessionInfo::getReservedForForwarding() const
{
return reservedForForwarding;
}
int SessionInfo::getForwardFd() const
{
return forwardFd;
}
void SessionInfo::setReservedForForwarding(bool reservedForForwarding)
{
this->reservedForForwarding = reservedForForwarding;
}
void SessionInfo::setForwardFd(int forwardFd)
{
this->forwardFd = forwardFd;
}
std::ostream &operator<<(std::ostream &os, const SessionInfo &sessionInfo)
{
os << "("
<< " fd = " << sessionInfo.fd
<< ", reservedForForwarding = " << sessionInfo.reservedForForwarding
<< ", forwardFd = " << sessionInfo.forwardFd
<< ")";
// TODO
//os << FORMAT()(fd)(reservedForForwarding)(forwardFd);
return os;
}
} // namespace RCF
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Software developer, from Sweden and now living in Canberra, Australia, working on distributed C++ applications. When he is not programming, Jarl enjoys skiing and playing table tennis. He derives immense satisfaction from referring to himself in third person.