conn.go 714 B

123456789101112131415161718192021222324252627282930313233
  1. package p2p
  2. import "net"
  3. type connFlag int32
  4. const (
  5. dynDialedConn connFlag = 1 << iota
  6. staticDialedConn
  7. inboundConn
  8. trustedConn
  9. )
  10. // conn wraps a network connection with information gathered
  11. // during the two handshakes.
  12. type conn struct {
  13. fd net.Conn
  14. //transport
  15. //node *enode.Node
  16. flags connFlag
  17. cont chan error // The run loop uses cont to signal errors to SetupConn.
  18. //caps []Cap // valid after the protocol handshake
  19. name string // valid after the protocol handshake
  20. }
  21. //func (c *conn) String() string {
  22. // s := c.flags.String()
  23. // if (c.node.ID() != enode.ID{}) {
  24. // s += " " + c.node.ID().String()
  25. // }
  26. // s += " " + c.fd.RemoteAddr().String()
  27. // return s
  28. //}