Example #1
0
func (c *connection) handleIncoming(sn *session, l proton.Link) {
	if l.IsReceiver() {
		c.incoming.In <- newReceiver(makeIncomingLink(sn, l))
	} else {
		c.incoming.In <- newSender(makeIncomingLink(sn, l))
	}
}
Example #2
0
func (h *handler) linkError(l proton.Link, msg string) {
	proton.CloseError(l, amqp.Errorf(amqp.InternalError, "%s for %s %s", msg, l.Type(), l))
}
Example #3
0
func makeIncomingLinkSettings(pLink proton.Link, sn *session) linkSettings {
	return linkSettings{
		isSender:  pLink.IsSender(),
		source:    pLink.RemoteSource().Address(),
		target:    pLink.RemoteTarget().Address(),
		linkName:  pLink.Name(),
		sndSettle: SndSettleMode(pLink.RemoteSndSettleMode()),
		rcvSettle: RcvSettleMode(pLink.RemoteRcvSettleMode()),
		capacity:  1,
		prefetch:  false,
		pLink:     pLink,
		session:   sn,
	}
}
Example #4
0
// Set up a link from an incoming proton.Link.
func makeIncomingLink(sn *session, eLink proton.Link) incomingLink {
	l := incomingLink{
		link: link{
			session:   sn,
			isSender:  eLink.IsSender(),
			eLink:     eLink,
			source:    eLink.RemoteSource().Address(),
			target:    eLink.RemoteTarget().Address(),
			linkName:  eLink.Name(),
			sndSettle: SndSettleMode(eLink.RemoteSndSettleMode()),
			rcvSettle: RcvSettleMode(eLink.RemoteRcvSettleMode()),
			capacity:  1,
			prefetch:  false,
			done:      make(chan struct{}),
		},
	}
	l.str = eLink.String()
	return l
}
Example #5
0
// initIncoming sets link settings from an incoming proton.Link.
// Call in proton goroutine
func makeIncomingLink(sn *session, eLink proton.Link) link {
	l := link{
		session:  sn,
		isSender: eLink.IsSender(),
		eLink:    eLink,
		settings: LinkSettings{
			Source:        eLink.RemoteSource().Address(),
			Target:        eLink.RemoteTarget().Address(),
			Name:          eLink.Name(),
			SndSettleMode: SndSettleMode(eLink.RemoteSndSettleMode()),
			RcvSettleMode: RcvSettleMode(eLink.RemoteRcvSettleMode()),
		},
	}
	l.setSettings()
	return l
}
Example #6
0
// Set up a link from an incoming proton.Link.
func makeIncomingLink(sn *session, eLink proton.Link) incomingLink {
	l := incomingLink{
		incoming: makeIncoming(eLink),
		linkSettings: linkSettings{
			isSender:  eLink.IsSender(),
			source:    eLink.RemoteSource().Address(),
			target:    eLink.RemoteTarget().Address(),
			linkName:  eLink.Name(),
			sndSettle: SndSettleMode(eLink.RemoteSndSettleMode()),
			rcvSettle: RcvSettleMode(eLink.RemoteRcvSettleMode()),
			capacity:  1,
			prefetch:  false,
			eLink:     eLink,
			session:   sn,
		},
	}
	return l
}