'Create a new L{Server} based on an existing connected I{SOCK_STREAM}
socket.
Arguments are the same as to L{Server.__init__}, except where noted.
@param fileDescriptor: An integer file descriptor associated with a
connected socket.  The socket must be in non-blocking mode.  Any
additional attributes desired, such as I{FD_CLOEXEC}, must also be
set already.
@return: A new instance of C{cls} wrapping the socket given by
C{fileDescriptor}.'

@classmethod
def _fromConnectedSocket(cls, fileDescriptor, factory, reactor):

    skt = socket.fromfd(fileDescriptor, socket.AF_UNIX, socket.SOCK_STREAM)
    protocolAddr = address.UNIXAddress(skt.getsockname())
    proto = factory.buildProtocol(protocolAddr)
    if (proto is None):
        skt.close()
        return
    sessionno = 0
    self = cls(skt, proto, skt.getpeername(), None, sessionno, reactor)
    self.repstr = ('<%s    #%s    on    %s>' % (self.protocol.__class__.__name__, self.sessionno, skt.getsockname()))
    self.logstr = ('%s,%s,%s' % (self.protocol.__class__.__name__, self.sessionno, skt.getsockname()))
    proto.makeConnection(self)
    return self
