LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-11-2002, 10:20 AM   #1
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
stdin -> port -> stdout


anyone know of an easy way to take the stdout of a program and send it to a port, and to then be able to connect to that port from somewhere else and and give it as the stdout? I want to piece together a simple lan video stream, so i could use

cat film.avi | toport host 1234

and then

fromport host 1234 | mplayer -

netcat can do this, but i want to be able to conect to the port more than once (so a film will be playing synchronized in two locations. any idea.
 
Old 04-11-2002, 06:49 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
Maybe Apache can serve it as well as any, tho IMO "sychronized" will be a problem, there's no way any consecutive viewer can receive hints from the system or the file served where the first hookup occurred...
 
Old 04-11-2002, 07:04 PM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Original Poster
Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
well, shoutcast / icecast does the same thing with mp3's... must be an easy way. ahh well, it's just another thing stopping me working.
 
Old 04-12-2002, 06:08 AM   #4
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
I think this is what you are looking for:

http://home.t-online.de/home/gerd.o/netpipe.html
 
Old 04-12-2002, 06:30 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Original Poster
Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
404'd mik.
 
Old 04-12-2002, 07:01 AM   #6
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
Hmmm the link on the page seems to point to jan.o instead of gerd.o

This link does work:
http://home.t-online.de/home/gerd.o/netpipe.tar.gz

I was looking for a simple tool which will multicast any data from stdin. This small program seems to do the trick but he's got a bit of an expensive protocol written around it. He expects the clients to acknowledge all the data. It will work but will cause a lot of extra network traffic. The problem with udp is that it can lose packets during high network activity. But with streaming of audio or video it's not a disaster if one packet is lost because the screen might just flicker for one frame and then it will continue on with the next. He's added the acknowledging to make sure the data gets received intact.
You wanted to do something like stream an avi file. Standard avi files aren't a streaming format so the movie will get messed up if you lose one packet. That's why tcp might be a better way, but the problem with tcp is that if you are using two clients it will have to send the data to both clients, which would double network traffic.
Now that I think about it you'll probably run into all kinds of other troubles. So I think your quick simple solution isn't really feasible, unless you like to waste bandwidth and processing power.

You might want to look into streaming video servers if you want a complete solution.
 
  


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
unbuffered stdin Mike Davies Linux - Software 1 03-03-2006 01:13 AM
stdout stdin Furlinastis Linux - Newbie 3 08-12-2005 12:00 AM
Stdout And Stdin: Can't get it to do it "on the fly"... Eskild Programming 4 07-19-2005 01:41 PM
redirecting stdin and stdout with pipes: convincing apps they're for a terminal? prell Programming 1 09-02-2004 07:38 AM
redirect stdin/stdout of running process xtravar Linux - Software 3 03-06-2004 08:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

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