| 1 | module net |
| 2 | |
| 3 | // Connection provides a generic SOCK_STREAM style interface that protocols can use |
| 4 | // as a base connection object to support TCP, UNIX Domain Sockets and various |
| 5 | // proxying solutions. |
| 6 | pub interface Connection { |
| 7 | addr() !Addr |
| 8 | peer_addr() !Addr |
| 9 | mut: |
| 10 | read(mut []u8) !int |
| 11 | write([]u8) !int |
| 12 | close() ! |
| 13 | } |
| 14 |