dotnetremoting

package
v1.47.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentDistribution

type ContentDistribution string
const (
	ContentDistributionNotChunked ContentDistribution = "\x00\x00"
	ContentDistributionChunked    ContentDistribution = "\x01\x00"
)

type HeaderDataFormat

type HeaderDataFormat string
const (
	HeaderDataFormatVoid          HeaderDataFormat = "\x00"
	HeaderDataFormatCountedString HeaderDataFormat = "\x01"
	HeaderDataFormatByte          HeaderDataFormat = "\x02"
	HeaderDataFormatUint16        HeaderDataFormat = "\x03"
	HeaderDataFormatInt32         HeaderDataFormat = "\x04"
)

type HeaderToken

type HeaderToken string
const (
	HeaderTokenEndHeaders      HeaderToken = "\x00\x00"
	HeaderTokenCustom          HeaderToken = "\x01\x00"
	HeaderTokenStatusCode      HeaderToken = "\x02\x00"
	HeaderTokenStatusPhrase    HeaderToken = "\x03\x00"
	HeaderTokenRequestURI      HeaderToken = "\x04\x00"
	HeaderTokenCloseConnection HeaderToken = "\x05\x00"
	HeaderTokenContentType     HeaderToken = "\x06\x00"
)

type Message

type Message struct {
	PreambleData string
	HeaderData   string
}

types and 'enums'.

func (*Message) AddCloseConnectionHeader

func (msg *Message) AddCloseConnectionHeader()

func (*Message) AddContentTypeHeader

func (msg *Message) AddContentTypeHeader(contentType string)

this will probably be application/octet-stream almost every time but making options.

func (*Message) AddCustomHeader

func (msg *Message) AddCustomHeader(headerName string, headerValue string)

uri in this case should probably look something like tcp://1.2.3.4:2814/SomeEndpoint

func (*Message) AddStatusCodeHeader

func (msg *Message) AddStatusCodeHeader(isError bool)

func (*Message) AddStatusPhraseHeader

func (msg *Message) AddStatusPhraseHeader(statusPhrase string)

func (*Message) AddURIHeader

func (msg *Message) AddURIHeader(uri string, headerToken HeaderToken)

uri in this case should probably look something like tcp://1.2.3.4:2814/SomeEndpoint

func (*Message) GetMessage

func (msg *Message) GetMessage(data string) string

Run this when you are finished putting headers and such together. This function will also add the end header so you should not write that part anywhere else. Obviously pass "" as the arg if you do not have data to add.

func (*Message) WriteDefaultPreamble

func (msg *Message) WriteDefaultPreamble(uri string, opType OperationType, dataLength int)

Can be used for 'most' things, otherwise use WritePreamble.

func (*Message) WritePreamble

func (msg *Message) WritePreamble(uri string, opType OperationType, dataLength int, contentDistribution ContentDistribution, contentType string)

The 'preamble' is basically the set of headers before the body.

type MessageResponse

type MessageResponse struct {
	MajorVersion        string
	MinorVersion        string
	OperationType       string
	ContentDistribution string
	DataLength          int
	Headers             map[string]string
	Data                string
}

Strings, because go thinks strings are as nifty as bytes.

func ParseResponseFromConn

func ParseResponseFromConn(conn net.Conn) (MessageResponse, bool)

Parsing functions.

func (*MessageResponse) Dump

func (msg *MessageResponse) Dump()

type OperationType

type OperationType string
const (
	OperationTypeRequest       OperationType = "\x00\x00"
	OperationTypeOneWayRequest OperationType = "\x01\x00"
	OperationTypeReply         OperationType = "\x02\x00"
)

type StringEncoding

type StringEncoding string
const (
	StringEncodingUnicode StringEncoding = "\x00"
	StringEncodingUtf8    StringEncoding = "\x01"
)

type TCPStatusCode

type TCPStatusCode string
const (
	TCPStatusCodeSuccess TCPStatusCode = "\x00"
	TCPStatusCodeError   TCPStatusCode = "\x01"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL