Small InterprocessConnection FR


#1

Jules,

I know this is somewhat stretching the domain of the InterprocessConnection class, but would it be possible to expose the ip address of the current connection?

It’d sometimes be useful to have the ability to access this data (if only to restrict the IPs[1] that can connect). As such, an addition to ICS would allow the createConnectionObject() virtual to selectively create ICs, or more generally to give the IC class a method like (untested, and not checked for typos):

const String InterprocessConnection::getHostName() const 
{
  if (pipe != 0) 
     return String("localhost");
  else if (socket != 0)
  {  
      if (socket->isLocal())
        return String("localhost");
      else
        return socket->getHostName();
  }
  else 
     return String::empty; 
}

[1] locking down the open port of an IC to accept localhost only for example, is not an unreasonable thing to want to do.


#2

Sounds pretty sensible, I can add that.


#3

Thanks Jules.