router: Update TCP route instead of returning ErrExists.

Most likely not fit for merging yet. Thought I'd make it available for a review at least. 

refs: #56
Yeah, I can get this sorted out, since #65 will require a few changes that
will bring the TCP backend more on-par with the HTTP one.
On 19 Aug 2014 10:39, "Jonathan Rudenberg" <notifications@github.com> wrote:

> In router/tcp.go:
>
> > @@ -148,19 +148,27 @@ func (h *tcpSyncHandler) Set(data *router.Route) error {
> >  	if h.l.closed {
> >  		return nil
> >  	}
> > -	if _, ok := h.l.services[r.Port]; ok {
> > -		return ErrExists
> > +
> > +	s := h.l.services[r.Port]
> > +
> > +	// clean up existing service
> > +	if s != nil {
> > +		s.l.Close()
>
> Hmm, this will make the listener unavailable. Ideally we'd just swap the
> service set without closing the listener. I think @archSeer
> <https://github.com/archSeer> is working on a larger refactor of this
> code.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/flynn/flynn/pull/135/files#r16395688>.
>