Information sending from a program to me

My game shall send game data to somewhere where i have access to. the data is textfiles.
But it shall work on every pc, so i dont want to install any extensions or so...
it simply shall send data to an accesstible location.
Could you please give me code examples?

Last edited on
That would depend on how you want to receive the information. Obviously you will need a server of some kind for the game to send data to.

the simplest way would be to have a website, you could use a stringchain and pass it in the url of your site.
As for the library to use I recommend libcurl:
http://curl.haxx.se/

Of course, you could use sockets, but it requires more work and is more bug prone.
Is there a reason why Email wouldn't suffice? That's how monitoring software like Nagios does this. Just have your app send out incremental reports to a gmail account or something; ESMTP is easy. I don't see a reason to reinvent the wheel here.
As the game is running on different computers, sending emails can be blocked for multiple reasons, but using http protocol will always work.
I can understand how outgoing Email can be blocked, virtually every Antivirus out there has this ability. But you're going to have to elaborate about how http can NOT be blocked. The last time I checked restricting access to port 80 on a per application basis is just as easy as blocking Email.
closed account (Dy7SLyTq)
not true. its possible to block port 80 modoran. in my computer apps class he can restrict access from the internet via a webfilter on a per machine basis, thus rendering the http protocol useless
OK. Lets say i use sockets. Could you please give me an example?

To Computergeek01: When i designed the game i firstly had the idea of sending emails with the game information but then when i looked up in the internet how to do it, every solution which was given dint work.
But if ESMTP works: how do i do it?
Remember: it shall work on every pc!!

to Jaybob66: What do you mean with passing into the URL?
Im not good on PHP this is because I have not that access to the internet to have a server running; i can only look up things and send things - parents...
Last edited on
passing data in the url is how must websites work for submitting data, do a google search for something and look in your address bar to see it. or read this http://www.w3.org/TR/2000/NOTE-SOAP-20000508/

I suggested http over other methods because:

#1 sending email requires an email client which isn't guaranteed on any platform as many people use webmail services these days. Although you could compile one into your game.

#2 writing your own protocol and server can be time consuming and costly.

#3 whichever method you choose needs to be secure so you don't end up like those poor sods at snap-chat, securing end user data is VERY important if you don't want to get a bad name.


not true. its possible to block port 80 modoran. in my computer apps class he can restrict access from the internet via a webfilter on a per machine basis, thus rendering the http protocol useless


If you can't change your webfilter settings you most likely cannot install/run the game in the first place.

OP wants a generic solution which works out of the box in typical user computers.

There is most likely chances that port 25 is blocked by the ISP itself, not by a user program. Port 80 cannot be blocked by ISP, because this means you cannot browse the internet.

If there is some webfilter installed just warn the user to allow the game to make traffic, user should accept it as this is supposed to be a legimitate program and user WANTS to make internet traffic, that's why I recommend using HTTP POST and port 80 (or even better, using port 443 and SSL encryption).
#1 sending email requires an email client which isn't guaranteed on any platform as many people use webmail services these days. Although you could compile one into your game.

This is so far from true that I don't even know where to begin correcting you so I'll just copy paste some links to documentation: http://www.faqs.org/rfcs/rfc821.html
http://www.faqs.org/rfcs/rfc2554.html


#2 writing your own protocol and server can be time consuming and costly.

All the more reason not to try setting up your own server and using http.
@computergeek01 - i followed those links, are you suggesting that the OP should write their own SMTP client?

#2 see point 1.
No, the links tell you that you don't need a client to send E mail. Sending an Email is accomplished simply by connecting to port 25 on a mail server and sending a few verbs and some formatted text with the sockets library. This is, in essence, as simple as bind(), connect(), send() and recv().

SHAMELESS SELF PLUG: I actually have an article in the works for this but I'm still being obstinate about resorting to a library for the encryption and still getting a handle on the RFC's myself. My sample code works on my mail server where local addresses don't require encrypted connections; or even authentication for that matter <:P. But asking people to set up a mail server for my tutorial seems too lazy on my part.

EDIT: My mistake, bind() is for server side connections.
Last edited on
Topic archived. No new replies allowed.