Class NetworkProtocol
Metadata on an IPFS network address protocol.
Inherited Members
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 SourceCode
The IPFS numeric code assigned to the network protocol.
Declaration
public abstract uint Code { get; }
Property Value
Type | Description |
---|---|
UInt32 |
Name
The name of the protocol.
Declaration
public abstract string Name { get; }
Property Value
Type | Description |
---|---|
String |
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 SourceReadValue(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.
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
| Improve this Doc View SourceRegister<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. |
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. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
| Improve this Doc View SourceWriteValue(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.
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.