1. networking help/advice needed
- Posted by hacker Aug 14, 2010
- 1399 views
I would like to start using Euphoria for networking applications. I'm TOTALLY clueless about how to go about this, but I've found a cross-platform package in the archive called "eunet" which seems to be what I'm looking for. At the moment I'm only interested in executing HTTP requests (I would like to create an application which downloads random numbers. See http://www.random.org/clients/http/ ).
Keep in mind that I'm using version 3.1.1 of Euphoria and would prefer not to use 4.0 until it's stable, but I'm aware it includes a socket library - could I use some of this code in 3.1.1?
I'm finding it hard to get my head around networking concepts, I understand the basics of HTTP requests but when it comes to actually writing the code I don't know where to begin. Any advice appreciated, thanks in advance!
2. Re: networking help/advice needed
- Posted by mattlewis (admin) Aug 14, 2010
- 1328 views
Keep in mind that I'm using version 3.1.1 of Euphoria and would prefer not to use 4.0 until it's stable, but I'm aware it includes a socket library - could I use some of this code in 3.1.1?
4.0 is getting pretty stable these days. I'm sure there are some bugs still lurking, but it's pretty solid at this point. We're looking to get a beta 4 out, with the intention of moving to RC quickly.
The networking code in the standard library of 4.0 relies on changes to the back end. OTOH, I believe that it all started with eunet, and moved into the backend, with the euphoria code mainly becoming thin wrappers of that code (largely, I think, because it was easier to make it all portable that way).
I'm not very knowledgeable on networking, so I can't tell you much more than that.
Matt
3. Re: networking help/advice needed
- Posted by useless Aug 14, 2010
- 1352 views
See news.ex in the Eu v4b2 demos. I can't get it to work in the b3.
useless
4. Re: networking help/advice needed
- Posted by mattlewis (admin) Aug 14, 2010
- 1342 views
See news.ex in the Eu v4b2 demos. I can't get it to work in the b3.
I don't know what the issues with it were, but it's been fixed in svn.
Matt
5. Re: networking help/advice needed
- Posted by hacker Aug 14, 2010
- 1326 views
Thanks Matt. Maybe I'll give 4.0 a try, but I'd really like to see an example of how to "talk to" a server rather than simply downloading a web page, which I could easily do using wget without any need for sockets.
6. Re: networking help/advice needed
- Posted by mattlewis (admin) Aug 14, 2010
- 1358 views
Thanks Matt. Maybe I'll give 4.0 a try, but I'd really like to see an example of how to "talk to" a server rather than simply downloading a web page, which I could easily do using wget without any need for sockets.
There are some demos:
Matt
7. Re: networking help/advice needed
- Posted by hacker Aug 14, 2010
- 1292 views
Wow, thanks Matt!
So the last update was b3 in March, correct? I actually need both the Linux (Debian) and Windows versions. Linux is my main OS, and Euphoria for windows seems to run fine in Wine.
8. Re: networking help/advice needed
- Posted by useless Aug 14, 2010
- 1322 views
You're welcome.
useless
9. Re: networking help/advice needed
- Posted by mattlewis (admin) Aug 14, 2010
- 1381 views
Wow, thanks Matt!
So the last update was b3 in March, correct? I actually need both the Linux (Debian) and Windows versions. Linux is my main OS, and Euphoria for windows seems to run fine in Wine.
Yes, that was the last released version. I think there have been changes that you might need to run those demos as they are in the head of svn. For linux, at least, you can get updated binaries here:
http://jeremy.cowgar.com/eubins/linux/
Hopefully, as I said, beta 4 will be out in the next week or so.
Matt
10. Re: networking help/advice needed
- Posted by hacker Aug 14, 2010
- 1280 views
I've downloaded the latest version for Linux, um... I'm a bit lost. I assume that euc is the translator, but which of eub and eui is the interpreter?
Also, I use the euphoria editor, is this available for version 4.0?
11. Re: networking help/advice needed
- Posted by jimcbrown (admin) Aug 14, 2010
- 1274 views
I've downloaded the latest version for Linux, um... I'm a bit lost. I assume that euc is the translator, but which of eub and eui is the interpreter?
Also, I use the euphoria editor, is this available for version 4.0?
eui is the interpreter.
The same euphoria editor should be in 4.0 but I am not sure how well tested it is.
12. Re: networking help/advice needed
- Posted by CoJaBo Aug 14, 2010
- 1375 views
At the moment I'm only interested in executing HTTP requests (I would like to create an application which downloads random numbers. See http://www.random.org/clients/http/ ).
For that particular application, the demo you are looking for is wget.ex. You don't want to be building the raw HTTP requests yourself, ever, thats what the standard libs are for. If you want to do something with a custom protocol (like a chat client or internet game), the chat demos posted prior should show you how to do raw sockets.
Its almost trivial to adapt the wget demo-
set_sendheader("User-Agent","EuRandBot/1.0 (Operator Contact: YOUR@EMAIL-ADDRESS.HERE)") numbers=get_url("http://www.random.org/integers/?num=10&min=1&max=6&col=1&base=10&format=plain&rnd=new") --Retrieve 10 base-10 numbers from 1-6. Change parameters as needed.
Make sure numbers is a sequence (since network requests can fail at random), then use your numbers.
And don't forget to check the quota if you intend to hit the server more than a few times a day.
13. Re: networking help/advice needed
- Posted by hacker Aug 15, 2010
- 1253 views
Thanks CoJaBo.
Looking through the 4.0 documentation, I see you guys have done a massive amount of work - REALLY impressive. It makes ver 3.1.1 look like "Euphoria lite".