A Google search turns up a few old Pidgin bug reports that suggest this problem is caused by a firewall of some sort. Are you by chance running some sort of firewall software on your machine? Have you tried disabling it temporarily to see if that fixes the problem? Maybe Pidgin needs to be whitelisted?