🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Should I Get A Low-Level Or A High-Level Lib For A Really Basic, Not Secured, High-Latency Networking?

Started by
11 comments, last by Heelp 7 years, 11 months ago
If you have only opened that single port, and that port is being listened to by your application, then the only damage someone else can do to your computer is through your program. For example, if your program contains a call to delete a file, and it gets the filename from the network, then theoretically your friends could make your program delete an important file if you're not checking those names first.

Practically however, you don't have anything to worry about (although maybe you should consider getting better friends).
Advertisement

when I actually open a port without any security, I open myself to some bad stuff they can do to harm my pc


Opening a port gives the external world access to whatever is available on that port.
If it's your chat program, and it has no bugs, then it only gives the world access to that port.
If it's your chat program, and you have bugs (such as buffer overflows,) then a skilled attacker may be able to break out of the server executable that you are running.
However, in practice, it's unlikely that a skilled attacker will be interested in your program while it's small, so in reality, the risk is minimal, unless you do something really crazy like allow users to run shell commands through chat or whatever.

That being said, hosting on your home computer on your home network is always troublesome -- you can't keep it up forever, your IP address may change, your computer is also needed for other things, ...
Instead, I recommend a cheap hosting provider of some sort. I myself use $6 virtual private servers from interserver.net but there are others -- $10 from linode -- $15 from dreamhost -- micro instances from amazon.
If you want to run Windows, they usually cost a bit more (and you can also look at [ulr=https://azure.microsoft.com/en-us/]Microsoft Azure[/url])
The benefit with these is that you can pay for them for as long as you need them (Amazon: hourly; most others: monthly) and then stop paying for them.
Also, if the machine gets hacked, just destroy the instance, fix the bug, and spin up a new instance.
enum Bool { True, False, FileNotFound };

Guys, thanks a lot for your detailed answers, I thought that when I open a port, it's like an open door, I didn't know that the port is being opened only to that specific program. It's exactly what I wanted to hear. :)

This topic is closed to new replies.

Advertisement