Added generic param for socket