LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Fastest, most efficient server Input (https://www.linuxquestions.org/questions/programming-9/fastest-most-efficient-server-input-287134/)

DirtyDan 02-06-2005 11:47 PM

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. :p

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

bigearsbilly 02-07-2005 03:50 AM

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.

DirtyDan 02-07-2005 08:44 AM

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 :newbie:

bigearsbilly 02-07-2005 09:43 AM

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.

DirtyDan 02-07-2005 04:44 PM

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?


bigearsbilly 02-08-2005 03:25 AM

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!


All times are GMT -5. The time now is 11:10 PM.