[gst-devel] TCP networking help.

Thomas Vander Stichele thomas at apestaart.org
Wed Dec 7 16:19:02 CET 2005


On Wed, 2005-12-07 at 11:28 -0800, Savage, ShaunX V wrote:
> Hi All
> 
>  
> 
> Time for bleeding edge help.  My goal is to connect one (or more)
> clients to a server using tcpserversink and tcpclientsource.
> 
>  
> 
> What I think I want to do.  I am writing it in C but I will use
> commandline notations.
> 
> On the server side have a pipeline of “filesrc !  tcpserversink”  I
> set the location on filesrc and I add a (client_added) signal handler
> on tcpserversink.
> 
>  
> 
> If the pipeline is paused , nothing, when set to running
> 
>  
> 
>  Setting to PLAYING
> 
> DEBUG (0x8ff40a8 - 0:00:00.371545000)        tcpserversink(15845)
> gsttcpserversink.c(262):gst_tcp_server_sink_init_send:<server-sink>
> opened sending server socket with fd 17
> 
> DEBUG (0x8ff40a8 - 0:00:00.371694000)        tcpserversink(15845)
> gsttcpserversink.c(290):gst_tcp_server_sink_init_send:<server-sink>
> binding server socket to address
> 
> DEBUG (0x8ff40a8 - 0:00:00.371859000)        tcpserversink(15845)
> gsttcpserversink.c(310):gst_tcp_server_sink_init_send:<server-sink>
> listening on server socket 17 with queue of 5
> 
> DEBUG (0x8ff40a8 - 0:00:00.372002000)        tcpserversink(15845)
> gsttcpserversink.c(319):gst_tcp_server_sink_init_send:<server-sink>
> listened on server socket 17, returning from connection setup
> 
> Running
> 
> End-of-stream
> 
> Returned, stopping playback
> 
> Deleting pipeline
> 
>  
> 
> The pipeline does not wait so there is no time for clients to
> connect. 

You have no synchronization in your pipeline at all.  So the pipeline
will play as fast as it can, consuming 100% cpu until it reaches EOS.
In this mode, you probably aren't starting up the client pipeline fast
enough :)

You could do a bunch of things:

a) put in an element in between that "knows" what sort of data it is so
that it can timestamp the data correctly
b) use identity and the datarate property to limit the rate of data
c) use tcpserversrc on the consumer pipeline, which will block until it
receives data, then start up the serving pipeline with tcpclientsink.
This configuration will in fact block until the sending side starts.

hope that helps,
Thomas



>  
> 
> How do you setup a listen socket on a server?
> 
> What am I missing??  
> 
> 

Dave/Dina : future TV today ! - http://www.davedina.org/
<-*- thomas (dot) apestaart (dot) org -*->
Are you happy where you're sleeping ?
Does he keep you safe and warm ?
Does he tell you when you're sorry ?
Does he tell you when you're wrong ?
<-*- thomas (at) apestaart (dot) org -*->
URGent, best radio on the net - 24/7 ! - http://urgent.fm/







More information about the gstreamer-devel mailing list