Comments (4)
Closing since it is not really a bug
from go-diameter.
2 cases should be considered here:
- CEA contains no app ids and 5010 code
- CEA contains some app ids and 5010 code
from go-diameter.
This is a different issue than I initially thought and it is located in examples/client/client.go, client attempts to reconnect indefinitely regardless of type of error which happens in the progress.
for {
c, err := connect()
if err != nil {
log.Println(err)
backoff *= 2
if backoff > 20 {
backoff = 20
}
time.Sleep(time.Duration(backoff) * time.Second)
continue
}
log.Println("Client connected, handshake ok")
backoff = 1
<-c.(diam.CloseNotifier).CloseNotify()
log.Println("Client disconnected")
}
One might guard oneself against such situations with something like this in case err != nil
:
if err.Error()[len(err.Error())-4:] == "5010" {
log.Println("Permenent error received, aborting connection attempts")
break
}
But it does not look reliable (eg. err does not come necessarily from parsing CEA).
Such functionality (connect with backoff) can be potentially located somewhere inside sm/client.go and differentiate between type of errors and how to deal with them.
from go-diameter.
That code in the example/client is an example, not something you'd use for real use cases.
One option is to implement the diam.Conn
interface with specific client behavior, supporting things like auto reconnection (with back off), circuit breaker, and whatnot.
from go-diameter.
Related Issues (20)
- Does the 'Getting Started' instructions on Readme.md need update ? HOT 2
- Missing DeleteAVP functionality HOT 1
- CCR
- how to avoid dict.Default
- Empty AVP Payload causes crash
- Dangling AVP references in readerBufferPool
- How to parse AVP sub attributes ?
- unmarshal issue when two avp's with same id but different VendorId used
- diam_sctp_client is crashing on connection
- Make certificates optional in ListenAndServeTLS to allow an external callback
- server closes the connection HOT 3
- Performance on sctp is very poor
- Any way to leverage the XML to validate produced messages?
- Missing Handshake Notifications in channel
- multi-homing HOT 1
- One Client dials to Multiple Server HOT 2
- Close listening socket
- Diameter Client receving CCA HOT 3
- CCA Handler HOT 1
- CER/CEA remote peer validation HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-diameter.