This sounds like the game could not establish a connection to the server. If the server is in your local network (i.e. behind a router), and you want it to be reachable from the internet, it is necessary to forward the required ports in your router. By default the server requires port 4255 TCP and UDP, and if you want it to show up in the server list, it's also necessary to forward port 4254 TCP. Here you find more information about setting up a dedicated server: Dedicated Server Setup [New Version]
Also make sure there is no firewall blocking the game or server. If the server still doesn't work, you could maybe upload the latest server log (can be found in the "Logs" folder in the server directory) and the "server.properties" file here (or alternatively send it via PM to me).
However, if you just want to play with some friends, it's usually easier to just use the built-in "Play with Friends" option: In the singleplayer menu you can select a world and hit the green "Play with Friends" button, then other people can join your game through the Steam friend list without any additional setup required