def getTCPportConnCount(self, ipv4=True, ipv6=True, resolve_ports=False,<EOL>**kwargs):
port_dict = {}<EOL>result = self.getStats(tcp=True, udp=False, <EOL>include_listen=False, ipv4=ipv4, <EOL>ipv6=ipv6, resolve_ports=resolve_ports,<EOL>**kwargs)<EOL>stats = result['<STR_LIT>']<EOL>for stat in stats:<EOL><INDENT>if stat[<NUM_LIT:8>] == '<STR_LIT>':<EOL><INDENT>port_dict[stat[<NUM_LIT:5>]] = port_dict.get(<NUM_LIT:5>, <NUM_LIT:0>) + <NUM_LIT:1><EOL><DEDENT><DEDENT>return port_dict<EOL>
Returns TCP connection counts for each local port.

        @param ipv4:          Include IPv4 ports in output if True.
        @param ipv6:          Include IPv6 ports in output if True.
        @param resolve_ports: Resolve numeric ports to names if True.
        @param **kwargs:      Keyword variables are used for filtering the 
                              results depending on the values of the columns. 
                              Each keyword must correspond to a field name with 
                              an optional suffix:
                              field:          Field equal to value or in list 
                                              of values.
                              field_ic:       Field equal to value or in list of 
                                              values, using case insensitive 
                                              comparison.
                              field_regex:    Field matches regex value or 
                                              matches with any regex in list of 
                                              values.
                              field_ic_regex: Field matches regex value or 
                                              matches with any regex in list of 
                                              values using case insensitive 
                                              match.
        @return:              Dictionary mapping port number or name to the
                              number of established connections.