I have my friend's IP address and port, but when I click the accept button on the port screen my computer just lags a bit and acts like I never clicked the button!
Make sure the port is 7777 and that you're using your friend's exact IP address. (cmd - ipconfig). Terraria takes little space and should not lag unless something is terribly wrong. If this does not work try reinstalling the game or verifying the game cache to ensure no files are corrupted.