connection是TCP连接。
数据:inbuf, outbuf
操作:
- enable/disable: connection_{start,stop}_{reading,writing}
- read/write: conn_{read,write}_callback()
类型:
- edge connection: entry and exit connection是outside the tor network
- or connection: 基于TLS,发送接收Cell
- directory connection: 基于HTTP, 发送接收network status consensus文件等(HS descriptor也应该使用这个connection)
Channel是or connection上面Cell下面的抽象层,目前只有实现了基于TLS的Channel, 处理connection层握手协议以外的Cell.