func connect(type: SocketType,
                 closure: (Connection) throws -> Void) throws {
        try closure(connect(type: type))
    }