After much trial and error I found that the IP address I supplied to the connect
function was invalid.
I looked online for a list of valid multicast address and then changed the IP address to one of the valid ones and that got rid of that error.
Thanks