This commit is contained in:
crusader 2018-09-19 11:05:53 +09:00
parent 5f0c3e9fc6
commit 7d2c9c4328

View File

@ -73,7 +73,7 @@ func (d *ofDiscoverer) DiscoverStop(requesterID string, requestID string) {
if !ok {
return
}
s.(session.DiscoverySession).DiscoveryRequest().(*ofDiscoveryRequest).canceled.Store(true)
s.(session.DiscoverySession).Shutdown()
}
@ -167,9 +167,10 @@ LOOP:
d.processingSessions.Store(req.RequestID(), s)
d.discover(req, s)
select {
case <-time.After(time.Second * 1):
case <-time.After(time.Millisecond * 500):
}
d.SendMessage(req, types.DiscoveryMessageTypeStop, omu.Now())
s.DiscoveryRequest().(*ofDiscoveryRequest).canceled.Store(true)
if _, ok := d.processingSessions.Load(req.RequestID()); ok {
d.processingSessions.Delete(req.RequestID())