socklen_t length;
public:
InspSocket();
- InspSocket(int newfd);
+ InspSocket(int newfd, char* ip);
InspSocket(std::string host, int port, bool listening, unsigned long maxtime);
virtual bool OnConnected();
virtual void OnError(InspSocketError e);
UserCount = OperCount = 0;
}
+ std::string GetName()
+ {
+ return this->ServerName;
+ }
+
+ std::string GetDesc()
+ {
+ return this->ServerDesc;
+ }
+
+ std::string GetVersion()
+ {
+ return this->VersionString;
+ }
+
+ int GetUserCount()
+ {
+ return this->UserCount;
+ }
+
+ int GetOperCount()
+ {
+ return this->OperCount;
+ }
+
+ TreeSocket* GetSocket()
+ {
+ return this->Socket;
+ }
+
+ TreeServer* GetParent()
+ {
+ return this->Parent;
+ }
+
void AddChild(TreeServer* Child)
{
Children.push_back(Child);
this->LinkState = CONNECTING;
}
- TreeSocket(int newfd)
- : InspSocket(newfd)
+ TreeSocket(int newfd, char* ip)
+ : InspSocket(newfd, ip)
{
Srv->Log(DEBUG,"Associate new inbound");
this->LinkState = WAIT_AUTH_1;
{
if (this->LinkState == CONNECTING)
{
+ Srv->SendOpers("*** Connection to "+myhost+"["+this->GetIP()+"] established.");
// we should send our details here.
// if the other side is satisfied, they send theirs.
// we do not need to change state here.
void DoBurst(TreeServer* s)
{
log(DEBUG,"Beginning network burst");
+ Srv->SendOpers("*** Bursting to "+s->GetName()+".");
this->WriteLine("BURST");
this->WriteLine("ENDBURST");
}
virtual int OnIncomingConnection(int newsock, char* ip)
{
- TreeSocket* s = new TreeSocket(newsock);
+ TreeSocket* s = new TreeSocket(newsock, ip);
Srv->AddSocket(s);
return true;
}
this->state = I_DISCONNECTED;
}
-InspSocket::InspSocket(int newfd)
+InspSocket::InspSocket(int newfd, char* ip)
{
this->fd = newfd;
this->state = I_CONNECTED;
+ this->IP = ip;
}
InspSocket::InspSocket(std::string host, int port, bool listening, unsigned long maxtime)