1. networking help/advice needed

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!

new topic     » topic index » view message » categorize

2. Re: networking help/advice needed

hacker said...

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

new topic     » goto parent     » topic index » view message » categorize

3. Re: networking help/advice needed


See news.ex in the Eu v4b2 demos. I can't get it to work in the b3.

useless

new topic     » goto parent     » topic index » view message » categorize

4. Re: networking help/advice needed

useless said...

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

new topic     » goto parent     » topic index » view message » categorize

5. Re: networking help/advice needed

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.

new topic     » goto parent     » topic index » view message » categorize

6. Re: networking help/advice needed

hacker said...

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:

chat client

chat server

socket client

sock server

udp client

udp server

Matt

new topic     » goto parent     » topic index » view message » categorize

7. Re: networking help/advice needed

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.

new topic     » goto parent     » topic index » view message » categorize

8. Re: networking help/advice needed


You're welcome.

useless

new topic     » goto parent     » topic index » view message » categorize

9. Re: networking help/advice needed

hacker said...

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

new topic     » goto parent     » topic index » view message » categorize

10. Re: networking help/advice needed

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?

new topic     » goto parent     » topic index » view message » categorize

11. Re: networking help/advice needed

hacker said...

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.

new topic     » goto parent     » topic index » view message » categorize

12. Re: networking help/advice needed

hacker said...

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.

new topic     » goto parent     » topic index » view message » categorize

13. Re: networking help/advice needed

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".

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu