import socket


def init_tcp_conn(target: str, port: int) -> socket.socket:
    """
    Generic method to create a TCP socket connection to a specified target on a specified port.
    :param target: target to connect to
    :param port: port to connect to on target
    :return: connected socket object
    """
    conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    conn.connect((target, port))
    return conn