I reported this back in 2020, but I think there was confusion caused by my response. Snmpd definitely throws an error if a trapsink contains a TCP transport specifier:
# cat /etc/snmp/snmpd.conf
rocommunity public
trapsink tcp:10.224.4.161 public
# snmpd -f -Le
snmpd: netsnmp_create_notification_session:
/etc/snmp/snmpd.conf: line 3: Error: cannot create sink: tcp:10.224.4.161
net-snmp: 1 error(s) in config file(s)
NET-SNMP version 5.9
Here is some additional debugging, in case it helps:
# snmpd -f -Le -Dtdomain,snmp_sess
registered debug token tdomain, 1
registered debug token snmp_sess, 1
tdomain: netsnmp_tdomain_init() called
tdomain: domain_list -> { iso.3.6.1.6.1.9, "dtlsudp/dtls/dtlsudp6/dtls6" } -> { iso.3.6.1.6.1.8, "tlstcp/tls" } -> { iso.3.6.1.2.1.100.1.2, "udp6/ipv6/udpv6/udpipv6" } -> { iso.3.6.1.2.1.100.1.6, "tcp6/tcpv6/tcpipv6" } -> { iso.3.6.1.6.1.1, "udp" } -> { iso.3.6.1.2.1.100.1.5, "tcp" } -> { iso.3.6.1.4.1.8072.3.3.7, "alias" } -> { iso.3.6.1.2.1.100.1.13, "unix" } -> [NIL]
snmp_sess: opening transport: 0
snmp_sess: done opening transport: 20
snmp_sess_add: fd 3
tdomain: tdomain_transport_spec("snmptrap", "tcp:10.224.4.161", 0, "[NIL]", "[NIL]", "[NIL]")
tdomain: Found domain "tcp" from specifier "tcp"
tdomain: trying domain "tcp" address "10.224.4.161" default address ":162"
snmpd: netsnmp_create_notification_session:
/etc/snmp/snmpd.conf: line 3: Error: cannot create sink: tcp:10.224.4.161
net-snmp: 1 error(s) in config file(s)
tdomain: tdomain_transport_spec("snmp", "", 1, "[NIL]", "[NIL]", "[NIL]")
tdomain: checking for host specific config hosts/
tdomain: Use application default domains "udp" "udp6"
tdomain: Found domain "udp" from specifier "udp"
tdomain: trying domain "udp" address "" default address ":161"
snmp_sess: opening transport: 20
snmp_sess_add: fd 6
snmp_sess_add: limiting session rcv size (2147483647) to transport max (65507)
snmp_sess_add: limiting session snd size (2147483647) to transport max (65507)
NET-SNMP version 5.9
I'm using the generic Debian 11 snmpd distribution
# dpkg -l snmpd
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-==================-============-================================================
ii snmpd 5.9+dfsg-4+deb11u1 amd64 SNMP (Simple Network Management Protocol) agents
|