The ADB server creates a server socket on port 5037. But it only seems to do this on the loopback interface. When the adb port forwarder is started in server mode, it creates new server sockets bound to all network interfaces at port 6037 and routes all traffic to the local adb server at port 5037. When the adb port forwarder is running in server mode it also ensures that the adb server keeps running by executing an adb start-server command every minute.

The adb port forwarder which is running in client mode will connect to the adb port forwarder running in server mode and will route all incoming trafic on port 5037 to the remote host at port 6037. When the adb port forwarder is started in client mode it will first kill the local adb server if it’s running.