Skip to content

Commit

Permalink
refactor: rearrange link
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed Dec 10, 2024
1 parent 9a6be34 commit 952e599
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions face/ndnlp-link-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,25 @@ func (l *NDNLPLinkService) Run(optNewFrame []byte) {
<-l.hasImplQuit
l.HasQuit <- true
}

func (l *NDNLPLinkService) runSend() {
core.LogTrace(l, "Starting send thread")

if lockThreadsToCores {
runtime.LockOSThread()
}

for {
select {
case pkt := <-l.sendQueue:
sendPacket(l, pkt)
case <-l.hasTransportQuit:
l.hasImplQuit <- true
return
}
}
}

func sendPacket(l *NDNLPLinkService, pkt *defn.Pkt) {
wire := pkt.Raw

Expand Down Expand Up @@ -269,23 +288,6 @@ func sendPacket(l *NDNLPLinkService, pkt *defn.Pkt) {
l.transport.sendFrame(l.outFrame)
}
}
func (l *NDNLPLinkService) runSend() {
core.LogTrace(l, "Starting send thread")

if lockThreadsToCores {
runtime.LockOSThread()
}

for {
select {
case pkt := <-l.sendQueue:
sendPacket(l, pkt)
case <-l.hasTransportQuit:
l.hasImplQuit <- true
return
}
}
}

func (l *NDNLPLinkService) handleIncomingFrame(frame []byte) {
// We have to copy so receive transport buffer can be reused
Expand Down

0 comments on commit 952e599

Please sign in to comment.