socket: add some protocol functions
tcp: some more implementation