If you're on Windows, your firewall may not be configured to allow incoming connections to your server.
I don't own a Mac, and therefore I don't know if Mac has a restrictive firewall configured by default, or how to configure it if so. If you know, please contact me!
Open the Control Panel. Navigate to Windows Firewall. In the left pane, click "Allow an app or feature through Windows Firewall". It should be one of the first links at the top of the list.
You should be presented with a list of programs. Look for your program on the list. If you don't see it, click "Allow another app...", at the bottom of the Window. You can then enter the path to your program's executable or navigate the file system to search for it. Click "Add". Once you've found your program, ensure that the Private or Public boxes are ticked. Ticking these boxes allows the program to receive data over the network. If you're using a home network, you should tick the Private box. If you don't care about what type of network you're on, just tick both.