LinuxQuestions.org
Visit Jeremy's Blog.
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 02-06-2005, 11:47 PM   #1
DirtyDan
Member
 
Registered: Aug 2004
Posts: 41

Rep: Reputation: 15
Fastest, most efficient server Input


Hi, I am back to working on my remote-vehicle project that I started a while ago and realized that using a cgi script like the one I had trouble with earlier here might not be the best route. Average delay would be around 1 second, while I can ping the server in ~30ms. My goal here is to simply have the server take the input and run

#/usr/sbin/lptest $input

With it. Im working on a javascript to take keyboard input, but I have no idea how to send out the data quickly. Forms are not made for this sort of thing. I guess I could write a little program, but that means I have to take what little I know about C++ and expand it 1000 times.

What other options do I have here? Is there a way I could make the form post faster with less information passed back and forth? Or how else could I incorporate it into an html that would take a javascript-set variable? Thanks

-Dan
 
Old 02-07-2005, 03:50 AM   #2
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: NetBSD, Void, Debian, Mint, Ubuntu, Puppy, Raspbian
Posts: 3,487

Rep: Reputation: 233Reputation: 233Reputation: 233
Does that mean you are interacting with something
via a web browser?
If so, you will never get a quick response time.

You'll have to knock up your own client and server
using sockets.
 
Old 02-07-2005, 08:44 AM   #3
DirtyDan
Member
 
Registered: Aug 2004
Posts: 41

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by bigearsbilly
Does that mean you are interacting with something
via a web browser?
If so, you will never get a quick response time.

You'll have to knock up your own client and server
using sockets.

Oh, great. I can deal with that I guess but... where do I start? I don't have any experience whatsoever here
 
Old 02-07-2005, 09:43 AM   #4
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: NetBSD, Void, Debian, Mint, Ubuntu, Puppy, Raspbian
Posts: 3,487

Rep: Reputation: 233Reputation: 233Reputation: 233
well.
First choose you language.
perl definitely has socket functions,
tcl too, python I should imagine.
C of course but it's easire to do one in a scripting language.

I would try maybe tcl/tkbecause you can have a form interface up
in a trice.

If you imagine your socket as a pipe or fifo then generally you would
read it in a line oriented fashion exactly like reading a config file.
You could use simple name/parameter pairs on a line send to socket
and read the other end.
 
Old 02-07-2005, 04:44 PM   #5
DirtyDan
Member
 
Registered: Aug 2004
Posts: 41

Original Poster
Rep: Reputation: 15
I brushing up on some Tcl tutorials, no specifics on sockets yet though. Would this totally go around a web browser, as you said for speed? How would the client use the tcl script then if they were in windows, would they need to download something to run the Tcl script? This is a great start, Ill keep reading thanks

I just found a tutorial on Tclhttpd ; would a tcl web server be the way to go? I also have a webcam serving pictures through my current apache server; Maybe this is a dumb question, but is there a way to serve the image via a socket and increase the transfer time?


Last edited by DirtyDan; 02-07-2005 at 06:12 PM.
 
Old 02-08-2005, 03:25 AM   #6
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: NetBSD, Void, Debian, Mint, Ubuntu, Puppy, Raspbian
Posts: 3,487

Rep: Reputation: 233Reputation: 233Reputation: 233
You can put anything you like through a socket
(apart from small animals)

You can use a webserver but as you say it would be slower.
tclhttpd not sure. You could try of course.

Quote:
How would the client use the tcl script then if they were in windows, would they need to download something to run the Tcl script?
You can get tcl/tk for windows.

You make a form, get input, squirt it through the
socket, pick it up at the other end.


Quote:
is there a way to serve the image via a socket
That's how web servers work.
Of course you could do it
but it might get complicated.
One step at a time!
 
  


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
energy efficient apache server paranoid times Linux - General 10 10-24-2005 10:01 PM
Simple is efficient ???? Maybe/Maybe not ! bigjohn General 21 07-08-2005 10:27 AM
a more efficient set up dr_zayus69 Linux - Newbie 3 12-03-2004 09:47 AM
ide cabling -most efficient way? reetep Linux - Hardware 5 09-16-2004 12:47 PM
Most efficient cost effective way??? nor General 3 06-26-2003 11:39 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:29 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration