Show / Hide Table of Contents

Class NetworkProtocol

Metadata on an IPFS network address protocol.

Inheritance
Object
NetworkProtocol
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Namespace: Ipfs
Assembly: Ipfs.Core.dll
Syntax
public abstract class NetworkProtocol
Remarks

Protocols are defined at https://github.com/multiformats/multiaddr/blob/master/protocols.csv.

Properties

| Improve this Doc View Source

Code

The IPFS numeric code assigned to the network protocol.

Declaration
public abstract uint Code { get; }
Property Value
Type Description
UInt32
| Improve this Doc View Source

Name

The name of the protocol.

Declaration
public abstract string Name { get; }
Property Value
Type Description
String
| Improve this Doc View Source

Value

The string value associated with the protocol.

Declaration
public string Value { get; set; }
Property Value
Type Description
String
Remarks

For tcp and udp this is the port number. This can be null as is the case for http and https.

Methods

| Improve this Doc View Source

ReadValue(CodedInputStream)

Reads the binary representation from the specified Google.Protobuf.CodedInputStream.

Declaration
public abstract void ReadValue(CodedInputStream stream)
Parameters
Type Name Description
Google.Protobuf.CodedInputStream stream

The Google.Protobuf.CodedOutputStream to read from.

Remarks

The binary representation is an option Value.

| Improve this Doc View Source

ReadValue(TextReader)

Reads the string representation from the specified TextReader.

Declaration
public virtual void ReadValue(TextReader stream)
Parameters
Type Name Description
TextReader stream

The TextReader to read from

Remarks

The string representation is "/Name" followed by an optional "/Value".

| Improve this Doc View Source

Register<T>()

Register a network protocol for use.

Declaration
public static void Register<T>()
    where T : NetworkProtocol, new()
Type Parameters
Name Description
T

A NetworkProtocol to register.

| Improve this Doc View Source

RegisterAlias<T>()

Register an alias to another network protocol.

Declaration
public static void RegisterAlias<T>()
    where T : NetworkProtocol, new()
Type Parameters
Name Description
T

A NetworkProtocol to register.

| Improve this Doc View Source

ToString()

The Name and optional Value of the network protocol.

Declaration
public override string ToString()
Returns
Type Description
String
Overrides
Object.ToString()
| Improve this Doc View Source

WriteValue(CodedOutputStream)

Writes the binary representation to the specified Stream.

Declaration
public abstract void WriteValue(CodedOutputStream stream)
Parameters
Type Name Description
Google.Protobuf.CodedOutputStream stream

The Google.Protobuf.CodedOutputStream to write to.

Remarks

The binary representation of the Value.

| Improve this Doc View Source

WriteValue(TextWriter)

Writes the string representation to the specified TextWriter.

Declaration
public virtual void WriteValue(TextWriter stream)
Parameters
Type Name Description
TextWriter stream

The TextWriter to write to.

Remarks

The string representation of the optional Value.

See Also

MultiAddress
  • Improve this Doc
  • View Source
Back to top Generated by DocFX