fixacceptor

package
v0.0.0-...-81b279e Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CiDefaultHbtTime default heartbeat time 30 seconds
	CiDefaultHbtTime = 30

	// CiHbtMin min heartbeat time
	CiHbtMin = 5
	// CiHbtMax max heartbeat time
	CiHbtMax = 60

	// CiForceCloseTimeOut 5秒
	CiForceCloseTimeOut = 5
)
View Source
const (
	// DefaultSendBuffSize default send buff size
	DefaultSendBuffSize = 1 * 10000
)

Variables

This section is empty.

Functions

func GetNeededProcessNum

func GetNeededProcessNum() int

GetNeededProcessNum get gorountine numbers needed

Types

type Acceptor

type Acceptor struct {
	// contains filtered or unexported fields
}

Acceptor acceptor

func NewAcceptor

func NewAcceptor(set Settings, app ApplicationIF) *Acceptor

NewAcceptor new

func (*Acceptor) GetClientIdByCompId

func (ac *Acceptor) GetClientIdByCompId(targetCompID string) (clientID uint64, err error)

func (*Acceptor) SendToClient

func (ac *Acceptor) SendToClient(clientID uint64, msg interface{}) error

SendToClient send to client

func (*Acceptor) Start

func (ac *Acceptor) Start() error

Start start acceptor server

func (*Acceptor) Stop

func (ac *Acceptor) Stop()

Stop stop acceptor server

type ApplicationIF

type ApplicationIF interface {
	OnError(msg string, err error)
	OnErrorStr(msg string)
	OnEvent(msg string)
	FromAdmin(fixMsg *quickfix.Message)
	FromApp(fixMsg *quickfix.Message)
	OnSendedData(fixMsg *quickfix.Message)
	OnDisconnected(serverIP string, serverPort uint16)
}

ApplicationIF interface for upper FIX application

type Settings

type Settings struct {
	FixDataDictPath string

	Port uint16

	// tcp send buff size
	SendBuffsize int
	// receive callback if async or sync
	AsyncReceive bool

	// sended callback if async or sync
	AsyncSended bool

	BeginString  string
	SenderCompID string

	// ResetOnLogon Determines if sequence numbers should be reset when recieving a logon request.
	ResetOnLogon bool
}

Settings fix setting

func DefaultConfig

func DefaultConfig() Settings

Jump to

Keyboard shortcuts

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