"use strict";
//
//  Copyright (c) Microsoft Corporation. All rights reserved.
//
Object.defineProperty(exports, "__esModule", { value: true });
exports.PortForwardSuccessMessage = void 0;
const dev_tunnels_ssh_1 = require("@microsoft/dev-tunnels-ssh");
class PortForwardSuccessMessage extends dev_tunnels_ssh_1.SessionRequestSuccessMessage {
    constructor() {
        super(...arguments);
        this.port = 0;
    }
    onRead(reader) {
        super.onRead(reader);
        if (reader.available >= 4) {
            this.port = reader.readUInt32();
        }
    }
    onWrite(writer) {
        super.onWrite(writer);
        writer.writeUInt32(this.validateField(this.port, 'port'));
    }
    toString() {
        return `${super.toString()} (port=${this.port})`;
    }
}
exports.PortForwardSuccessMessage = PortForwardSuccessMessage;
//# sourceMappingURL=https://github.com/VSCodium/sourcemaps/releases/download/stable-4c0b0c6cc561d2d3636d1ec250935431876ce4dc/node_modules-@microsoft-dev-tunnels-ssh-tcp-messages-portForwardSuccessMessage.js.map