Skip to main content
GameDev.net gamedev.net
🔒 Locked

Network Programming for C#/XNA

Started by NotSpike Jan 26, 2010 at 10:46 AM 17 replies 4.6k views
Original Post
NotSpike
NotSpike

.

EJH
EJH
Are you sure your friend's IP is exposed? Is his router port-forwarding to the machine hosting the game? Most server apps hosted behind a router need to be port forwarded.
hplus0603
hplus0603
Read the links on NAT punch-through in the Forum FAQ.
enum Bool { True, False, FileNotFound };
hplus0603
hplus0603
Then you can't do NAT punch-through.
enum Bool { True, False, FileNotFound };
hplus0603
hplus0603
Either you set up port forwarding.
Or you bounce off a server you control.
Those are your options.

Now, if the transfer is slow, you could do it as "upload" plus "download" through some shared web host. As long as volume is low, and you can accept web host latencies, that could work. However, as soon as you get more traffic, your shared web host will kill your account.

Self-managed dedicated servers for $39/month available at http://www.interserve.net/
Note that I have no connection with them whatsoever, but it seems like a totally sweet deal!
enum Bool { True, False, FileNotFound };
hplus0603
hplus0603
Quote:
The game client connects to the MSSQL database directly


If your web host allows remote connections to the MySQL database, ditch them. They are toast, and probably already serving as a hub in multiple botnets and black trojan operations. It's a terribly bad idea, basically letting anyone on the Internet do anything to the database machine (even if it's "password protected" because passwords leak from any client binary).
enum Bool { True, False, FileNotFound };
Antheus
Antheus
Google AppEngine? Free, and with very liberal and well defined quotas. Some limits on how much processing can be done (IIRC, 30 seconds per request, and CPU time quotas).
Antheus
Antheus
Quote:
Original post by NotSpike
Never heard of this... will give it a look, you'd recommend this over using my own host?


- It sounds like you aren't interested into spending any money, which makes sense without an already working business model
- Google is... Google. It will be around for a while still, they have somewhat decent hardware, and allegedly they know their stuff, and they are also unlikely to be blocked or firewalled
- The quotas are written up-front and can be monitored - you will not get disconnected randomly or get random bills for overuse
- Aside from standard HTTP app interface it also provides cron jobs, something which typical web hosts don't, but is useful
- average bandwidth comes out at around 11kb/sec. While not much, consider that this is sustained usage, and is in practice enough to run 4 user interactive real-time app 24/7 (apparently, you need to check for turn of 2 players once a minute).
- Long-poll, or even just periodic polling is established method, and while the overhead is high, again, your use case makes it irrelevant
- There are downsides to AppEngine, but free only buys that much.

Alternatively, you could go Heroku. Free version gives you 5MB database and single request handler (only one request is handled at a time, so someone slamming your server can DoS you, but probably not relevant in this case), but is again enough for this scenario. Gotcha: it's Ruby. Another downside is that 'cron' jobs are not free.
Tibit
Tibit
Have you checked out the System.Net.PeerToPeer.Collaboration Namespace?

http://msdn.microsoft.com/en-us/library/system.net.peertopeer.collaboration.aspx

;)
// The only limit is the endless possibilities
hplus0603
hplus0603
Anyway, to answer the question more clearly: You should always put an application server in front of your database.
enum Bool { True, False, FileNotFound };

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.