Commit 27f3493e authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent ee71bd1a
...@@ -100,8 +100,8 @@ const ( ...@@ -100,8 +100,8 @@ const (
ConnServer ConnRole = iota // connection created as server ConnServer ConnRole = iota // connection created as server
ConnClient // connection created as client ConnClient // connection created as client
// for testing: do not spawn serveRecv & serveSend // for testing:
connNoRecvSend ConnRole = 1<<16 connNoRecvSend ConnRole = 1<<16 // do not spawn serveRecv & serveSend
connFlagsMask ConnRole = (1<<32 - 1) << 16 connFlagsMask ConnRole = (1<<32 - 1) << 16
) )
...@@ -314,6 +314,7 @@ runloop: ...@@ -314,6 +314,7 @@ runloop:
case txreq := <-nl.txreq: case txreq := <-nl.txreq:
fmt.Printf("%p\t (send) -> txreq\n", nl) fmt.Printf("%p\t (send) -> txreq\n", nl)
err := nl.sendPkt(txreq.pkt) err := nl.sendPkt(txreq.pkt)
fmt.Printf("%p\t (send) -> err: %v\n", nl, err)
if err != nil { if err != nil {
// XXX also close whole nodeLink since tx framing now can be broken? // XXX also close whole nodeLink since tx framing now can be broken?
} }
...@@ -369,6 +370,7 @@ func (c *Conn) Recv() (*PktBuf, error) { ...@@ -369,6 +370,7 @@ func (c *Conn) Recv() (*PktBuf, error) {
// worker for Close() & co // worker for Close() & co
func (c *Conn) close() { func (c *Conn) close() {
c.closeOnce.Do(func() { c.closeOnce.Do(func() {
fmt.Printf("%p Conn.close\n", c)
close(c.closed) // XXX better just close c.rxq + ??? for tx close(c.closed) // XXX better just close c.rxq + ??? for tx
}) })
} }
......
...@@ -225,6 +225,10 @@ func TestNodeLink(t *testing.T) { ...@@ -225,6 +225,10 @@ func TestNodeLink(t *testing.T) {
xwait(wg) xwait(wg)
// Close vs Send // Close vs Send
println("444.2")
//xclose(nl2) // so it does not receive what nl1 sends XXX wrong ->
//this will just make Send return error right after call
// TODO what is needed is nl2.serveRecv shutdown
c = nl1.NewConn() c = nl1.NewConn()
wg = WorkGroup() wg = WorkGroup()
wg.Gox(func() { wg.Gox(func() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment