discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Error on reconnecting to TCP port


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] Error on reconnecting to TCP port
Date: Mon, 26 Apr 2010 16:08:43 -0700
User-agent: Mutt/1.5.20 (2009-08-17)

On Sun, Apr 25, 2010 at 09:52:05PM -0700, Josh Blum wrote:
> Yes, definitely expected because of the way things are implemented:
> 
> The server block waits on listen, and passes the file descriptor to
> the first connection to the gnuradio file descriptor source/sink.
> After that there is no way for it to accept another connection and
> replace the file descriptor block.
> 
> To do this in a better way, we would probably need a more
> complicated tcp block, or something at the C++ level.
> 
> -Josh
> 
> 
> On 04/25/2010 09:32 PM, Berndt Josef Wulf wrote:
> >G'day,
> >
> >I've created a simple application in GRC using a TCP source in server mode.
> >When started, it excepts connections on the allocated port for the first 
> >time.
> >However, after statefully disconnecting from the port, any further attempts 
> >to
> >make a new connection with the server application fail - "connection 
> >refused".
> >Is this the expected behavior? I was assuming that it will accept new
> >connections after disconnecting from the previous session.
> >
> >cheerio Berndt

This stuff is easy to do Python.

Have python set up the listener, then call accept when somebody
connects.  Then either hand off the socket/file descriptor to a
gr_file_descriptor_{sink,source}, or do some dup2 magic to shuffle the
file descriptors around so that the file descriptor that a
gr_file_descriptor_{sink,source} already has open now refers the
socket that you're interested in.

Google for standard BSD socket examples.

Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]