fixinitiator

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: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CiAdminThPoolNum adminMsgTPool thread pool num
	CiAdminThPoolNum = 1

	// CiAppThPoolNum appMsgTPool thread pool num
	CiAppThPoolNum = 2

	// CiDefaultHbtTime default heartbeat time 30 seconds
	CiDefaultHbtTime = 30

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

	// CiForceCloseTimeOut 5秒
	CiForceCloseTimeOut = 5

	// CiReconnectTimeGap reconnect time gap 60 seconds
	CiReconnectTimeGap = 60

	// CiHoldingPattenMaxTime max holding patten stay time
	CiHoldingPattenMaxTime = 25
)
View Source
const (
	// DefaultSendBuffSize default send buff size
	DefaultSendBuffSize = 1 * 10000
)

Variables

This section is empty.

Functions

func GetNeededProccessNum

func GetNeededProccessNum() int

GetNeededProccessNum get gorountine numbers needed

Types

type ApplicationIF

type ApplicationIF interface {
	OnError(msg string, err error)
	OnErrorStr(msg string)
	OnEvent(msg string)
	OnConnected(serverIP string, serverPort uint16)    // connected event
	OnDisconnected(serverIP string, serverPort uint16) // disconnected event
	OnAdminMsg(fixmsg *quickfix.Message)               // receive admin message
	OnAppMsg(fixmsg *quickfix.Message)                 // receive application message
	OnSendedData(msg *MsgPkg)                          // message already sent
}

ApplicationIF interface for upper FIX application

type Initiator

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

Initiator initiator

func NewInitiator

func NewInitiator(set Settings, app ApplicationIF) *Initiator

NewInitiator new

func (*Initiator) SendMsgToSvr

func (intor *Initiator) SendMsgToSvr(msg *MsgPkg) (ready bool, err error)

SendMsgToSvr send to server

@return ready bool : initiator is ready to send message, but the condition is ok, if you try later it will succeed @return err error : initiator have error

func (*Initiator) SendPriorMsgToSvr

func (intor *Initiator) SendPriorMsgToSvr(msg *MsgPkg) error

SendPriorMsgToSvr send to server

func (*Initiator) SendPriorMsgesToSvr

func (intor *Initiator) SendPriorMsgesToSvr(msgs []*MsgPkg) error

SendPriorMsgesToSvr send to server

func (*Initiator) Start

func (intor *Initiator) Start(nxtSenderMsgSeqNum, nxtTargetMsgSeqNum uint64) error

Start initial initiator client

func (*Initiator) Stop

func (intor *Initiator) Stop()

Stop initial initiator client

type MsgPkg

type MsgPkg struct {
	Appendix interface{}
	Fixmsg   *quickfix.Message
}

MsgPkg outgoing send message package

func NewMsgPkg

func NewMsgPkg() *MsgPkg

NewMsgPkg new

type Settings

type Settings struct {
	FixDataDictPath string

	RemoteIP   string
	RemotePort uint16

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

	BeginString  string
	SenderCompID string
	TargetCompID string

	// configuration
	// ResetOnLogon Determines if sequence numbers should be reset when receiving 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