"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-824c4c46a288b839f13b24022655329c2aeb9f81/node_modules-@microsoft-dev-tunnels-ssh-tcp-messages-portForwardSuccessMessage.js.map