Skip to content
Browse files

Hacking on tcpdup

  • Loading branch information...
1 parent f42f9b5 commit b845d04c3166535ae3bdd94b03ef283fd551921a @mrb committed Jan 8, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 examples/tcpudp/main.go
View
6 examples/tcpudp/main.go
@@ -39,14 +39,16 @@ func tcpConnectAndRead(c syl.Channels) {
for {
select {
case <-c.Control:
- tcpConnectAndRead(c)
+ _, tcpConnector := maketcpConnecter()
+ go tcpConnector(c)
}
}
}
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)

0 comments on commit b845d04

Please sign in to comment.
Something went wrong with that request. Please try again.