From b845d04c3166535ae3bdd94b03ef283fd551921a Mon Sep 17 00:00:00 2001 From: mrb Date: Tue, 8 Jan 2013 08:16:54 -0500 Subject: [PATCH] Hacking on tcpdup --- examples/tcpudp/main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/tcpudp/main.go b/examples/tcpudp/main.go index a33362d..0f108be 100644 --- a/examples/tcpudp/main.go +++ b/examples/tcpudp/main.go @@ -39,7 +39,8 @@ func tcpConnectAndRead(c syl.Channels) { for { select { case <-c.Control: - tcpConnectAndRead(c) + _, tcpConnector := maketcpConnecter() + go tcpConnector(c) } } } @@ -47,6 +48,7 @@ func tcpConnectAndRead(c syl.Channels) { func maketcpConnecter() (tcp *net.TCPConn, event syl.Event) { event = func(c syl.Channels) { var err error + log.Print("tcp? ", tcp) tcp, err = conn.TcpConnect("localhost:2323") if err != nil { @@ -66,7 +68,7 @@ func maketcpReader(tcp *net.TCPConn) (event syl.Event) { dlen, err := tcp.Read(data) if err != nil { log.Print(err) - c.Error <- syl.NewEventError(c.NodeId, err) + c.Error <- err return } log.Printf("...read %d bytes from TCP", dlen)