streamtcp

package
v0.0.0-...-cbe29f7 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

通讯协议处理,主要处理封包和解包的过程

Index

Constants

View Source
const (
	ConstHeader                  = "SeanCommu"
	ConstHeaderLength      int32 = 9
	ConstSaveDataLength    int32 = 4
	ConstEndCheckECCLength int32 = 4

	TempToken = "e675d1b7e23c8a9ca3a3479d6cf29232"
)
View Source
const (
	ConstPackNoHeader  = 0
	ConstPackHasHeader = 1
)
View Source
const (
	NAME_PREFIX = "User "
)

Variables

This section is empty.

Functions

func BytesToInt

func BytesToInt(b []byte) int32

字节转换成整形

func BytesTouInt32

func BytesTouInt32(b []byte) uint32

字节转换成整形

func CheckECC

func CheckECC(data []byte) uint32

func GetUniq

func GetUniq() int

func IntToBytes

func IntToBytes(n int32) []byte

整形转换成字节

func Packet

func Packet(message []byte) []byte

封包

func UInt32ToBytes

func UInt32ToBytes(n uint32) []byte

整形转换成字节

func Unpack

func Unpack(buffer []byte, readerChannel chan []byte) (leftbuffer []byte)

解包

Types

This section is empty.

Jump to

Keyboard shortcuts

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