Since you can actually join the server means it's definitely not a firewall issue. If it was, you couldn't even get through the server chooser menu. To help you solve this issue would you mind describing it in a more detailed way? Does this only occur when you're both on the same server? In other words, can you join and play on the server when your friend, at that time, isn't playing? Also, when you get disconnected from the server, then look at the chat, it usually tells you the reason. Screenshots are also appreciated.