With socket activation, a port can be open while no process seems to listen on it. ss -ltnp then shows systemd as the owner, which does not tell you much.
Ask systemd for its own list:
systemctl list-sockets
The output has three columns: LISTEN with the address or path, UNIT with the socket unit and ACTIVATES with the service it starts. That usually includes the journal sockets under /run/systemd/journal, the D-Bus socket and any socket of your own, like 127.0.0.1:7777. For a socket with Accept=yes the last column shows a dash, because each connection gets its own instance.
It takes patterns, and --all also lists sockets that are loaded but not listening:
systemctl list-sockets --all 'ssh*'
I find this the quickest way to see why a port is open after you thought you had stopped a service. On Ubuntu, ssh.socket can keep port 22 open even when ssh.service is stopped, and the next connection simply starts it again.
It only covers sockets systemd owns. Ports opened by daemons themselves, or by containers, do not appear here; use ss -ltnp for the full picture.
Further reading: systemctl man page, systemd.socket man page