void ListenSocketIO::Listen(ConnectionOrientedSocketIO* aCOSocketIO) { MOZ_ASSERT(MessageLoopForIO::current() == GetIOLoop()); MOZ_ASSERT(mConnector); MOZ_ASSERT(aCOSocketIO); struct sockaddr* address = reinterpret_cast<struct sockaddr*>(&mAddress); mAddressLength = sizeof(mAddress); if (!IsOpen()) { int fd; nsresult rv = mConnector->CreateListenSocket(address, &mAddressLength, fd); if (NS_FAILED(rv)) { FireSocketError(); return; } SetFd(fd); } mCOSocketIO = aCOSocketIO; // calls OnListening on success, or OnError otherwise nsresult rv = UnixSocketWatcher::Listen(address, mAddressLength); NS_WARN_IF(NS_FAILED(rv)); }