LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-08-2011, 03:16 AM   #1
jaepi
Member
 
Registered: Apr 2007
Location: Urban Jungle
Distribution: Ubuntu
Posts: 189
Blog Entries: 1

Rep: Reputation: 30
Send a request to a http server without using sockets.


Hi, is it possible to send a request to a http server without using sockets?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 07-08-2011, 03:42 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,119

Rep: Reputation: 218Reputation: 218Reputation: 218
With Javascript, yes. Example here:

http://www.w3schools.com/Ajax/ajax_example.asp
 
Old 07-08-2011, 03:49 AM   #3
jaepi
Member
 
Registered: Apr 2007
Location: Urban Jungle
Distribution: Ubuntu
Posts: 189
Blog Entries: 1

Original Poster
Rep: Reputation: 30
Thank you for the reply. I'm sorry, my question was incomplete. I was referring to the C language.
 
Old 07-08-2011, 04:20 AM   #4
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,119

Rep: Reputation: 218Reputation: 218Reputation: 218
Don't think so. But there are of course many libraries you can use to make it simpler, for example libcurl. What's the problem with using sockets?
 
Old 07-10-2011, 09:46 PM   #5
jaepi
Member
 
Registered: Apr 2007
Location: Urban Jungle
Distribution: Ubuntu
Posts: 189
Blog Entries: 1

Original Poster
Rep: Reputation: 30
I was thinking if is it possible to implement a http client in u-boot that will download firmware files from the http server. U-boot only supports udc protocol. Correct me if I'm wrong, http takes place in tcp/ip sockets. I'm not sure if it can perform request using the udc protocol but as far as I have researched, it is not possible. In addition, u-boot has no socket support. I would really appreciate any advice about my issue.
 
Old 07-11-2011, 04:27 AM   #6
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
U-Boot has support for UDP over IP (but not TCP/IP). TFTP (Trivial File Transfer Protocol) was practically designed for this; it uses UDP/IP, and is supported by U-Boot. Is there a reason why you don't want to use TFTP?

TCP/IP requires quite a complex stack. Many of the implementations intended for embedded devices are quite restricted, for example to four TCP sockets total, with severe limitations on in-flight packets -- thus, very slow transfer rates. HTTP/1.1 is even more complex, especially if you want to communicate with arbitrary HTTP servers; in particular, the response may or may not be chunked. You can avoid most of those issues by using HTTP/1.0, but if the connection is via a proxy, further complications may occur. All it means is that the TCP/IP+HTTP stack is a complex beast, and definitely not suited in an embedded boot loader.

Last edited by Nominal Animal; 07-11-2011 at 04:33 AM. Reason: A wild duplicate appears!
 
2 members found this post helpful.
Old 07-11-2011, 02:57 PM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,750

Rep: Reputation: 462Reputation: 462Reputation: 462Reputation: 462Reputation: 462
bash can use TCP to download stuff if you compile it with the option enabled.
 
Old 07-11-2011, 10:34 PM   #8
jaepi
Member
 
Registered: Apr 2007
Location: Urban Jungle
Distribution: Ubuntu
Posts: 189
Blog Entries: 1

Original Poster
Rep: Reputation: 30
@Nominal Animal - Thank you for the detailed reply.
"Is there a reason why you don't want to use TFTP?" - I am already using the TFTP protocol. I have my TFTP server and client up and working.
As far as I have researched, I would totally agree with your statement here -> "All it means is that the TCP/IP+HTTP stack is a complex beast, and definitely not suited in an embedded boot loader." I just wanted to know if it is propable to implement an HTTP type of client in a bootloader for file transport/file download. I think it is but it would just be too complex without sockets. TFTP is really suited for automated transfer for bootfiles between my reference board and my host pc.

Thanks for your replies.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to send HTTP POST request using PPP over GPRS harsh_electro Linux - Networking 7 07-25-2008 09:01 PM
how i can view the file list available on server side through sending HTTP request? ankuraggarwal Linux - Software 1 09-06-2007 05:36 AM
HTTP REQUEST to Apache server from C program Balakrishnan84 Programming 6 07-26-2007 04:00 AM
sockets: Send string to server introuble Programming 13 07-02-2006 06:38 PM
Sockets: multiple send() calls throttle server framerate. JCipriani Programming 3 09-22-2005 07:06 PM


All times are GMT -5. The time now is 01:05 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration