# < Summary

Information

Class: | Renci.SshNet.Messages.Connection.CancelTcpIpForwardGlobalRequestMessage
Assembly: | Renci.SshNet
File(s): | \home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Connection\CancelTcpIpForwardGlobalRequestMessage.cs

Line coverage
90%

Covered lines: | 20
Uncovered lines: | 2
Coverable lines: | 22
Total lines: | 66
Line coverage: | 90.9%

Branch coverage
N/A

Covered branches: | 0
Total branches: | 0
Branch coverage: | N/A

Method coverage

Feature is only available for sponsors

Upgrade to PRO version

# Metrics

Method | Branch coverage | Cyclomatic complexity | Line coverage
--- | --- | --- | ---
.ctor(...) | 100% | 1 | 100%
get_AddressToBind() | 100% | 1 | 100%
set_AddressToBind(...) | 100% | 1 | 100%
get_PortToBind() | 100% | 1 | 100%
get_BufferCapacity() | 100% | 1 | 100%
LoadData() | 100% | 1 | 0%
SaveData() | 100% | 1 | 100%

# File(s)

## \home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Connection\CancelTcpIpForwardGlobalRequestMessage.cs

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System;`
|  | `2` |  | ``
|  | `3` |  | `namespace Renci.SshNet.Messages.Connection`
|  | `4` |  | `{`
|  | `5` |  | `internal sealed class CancelTcpIpForwardGlobalRequestMessage : GlobalRequestMessage`
|  | `6` |  | `{`
|  | `7` |  | `private byte[] _addressToBind;`
|  | `8` |  | ``
|  | `9` |  | `public CancelTcpIpForwardGlobalRequestMessage(string addressToBind, uint portToBind)`
| 137 | `10` |  | `: base(Ascii.GetBytes("cancel-tcpip-forward"), wantReply: true)`
| 137 | `11` |  | `{`
| 137 | `12` |  | `AddressToBind = addressToBind;`
| 137 | `13` |  | `PortToBind = portToBind;`
| 137 | `14` |  | `}`
|  | `15` |  | ``
|  | `16` |  | `/// <summary>`
|  | `17` |  | `/// Gets the address to bind to.`
|  | `18` |  | `/// </summary>`
|  | `19` |  | `public string AddressToBind`
|  | `20` |  | `{`
| 405 | `21` |  | `get { return Utf8.GetString(_addressToBind, 0, _addressToBind.Length); }`
| 411 | `22` |  | `private set { _addressToBind = Utf8.GetBytes(value); }`
|  | `23` |  | `}`
|  | `24` |  | ``
|  | `25` |  | `/// <summary>`
|  | `26` |  | `/// Gets port number to bind to.`
|  | `27` |  | `/// </summary>`
| 274 | `28` |  | `public uint PortToBind { get; private set; }`
|  | `29` |  | ``
|  | `30` |  | `/// <summary>`
|  | `31` |  | `/// Gets the size of the message in bytes.`
|  | `32` |  | `/// </summary>`
|  | `33` |  | `/// <value>`
|  | `34` |  | `/// The size of the messages in bytes.`
|  | `35` |  | `/// </value>`
|  | `36` |  | `protected override int BufferCapacity`
|  | `37` |  | `{`
|  | `38` |  | `get`
| 2 | `39` |  | `{`
| 2 | `40` |  | `var capacity = base.BufferCapacity;`
| 2 | `41` |  | `capacity += 4; // AddressToBind length`
| 2 | `42` |  | `capacity += _addressToBind.Length; // AddressToBind`
| 2 | `43` |  | `capacity += 4; // PortToBind`
| 2 | `44` |  | `return capacity;`
| 2 | `45` |  | `}`
|  | `46` |  | `}`
|  | `47` |  | ``
|  | `48` |  | `/// <summary>`
|  | `49` |  | `/// Called when type specific data need to be loaded.`
|  | `50` |  | `/// </summary>`
|  | `51` |  | `protected override void LoadData()`
| 0 | `52` |  | `{`
| 0 | `53` |  | `throw new NotImplementedException();`
|  | `54` |  | `}`
|  | `55` |  | ``
|  | `56` |  | `/// <summary>`
|  | `57` |  | `/// Called when type specific data need to be saved.`
|  | `58` |  | `/// </summary>`
|  | `59` |  | `protected override void SaveData()`
| 2 | `60` |  | `{`
| 2 | `61` |  | `base.SaveData();`
| 2 | `62` |  | `WriteBinaryString(_addressToBind);`
| 2 | `63` |  | `Write(PortToBind);`
| 2 | `64` |  | `}`
|  | `65` |  | `}`
|  | `66` |  | `}`

# Methods/Properties

.ctor(System.String,System.UInt32)
get_AddressToBind()
set_AddressToBind(System.String)
get_PortToBind()
get_BufferCapacity()
LoadData()
SaveData()