forked from linxGnu/gosmpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
state.go
55 lines (42 loc) · 1.28 KB
/
state.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package gosmpp
const (
Alive int32 = iota
Closed
)
// State represents Transmitter/Receiver/Transceiver state.
type State byte
const (
// ExplicitClosing indicates that Transmitter/Receiver/Transceiver is closed
// explicitly (from outside).
ExplicitClosing State = iota
// StoppingProcessOnly stops daemons but does not close underlying net conn.
StoppingProcessOnly
// InvalidStreaming indicates Transceiver/Receiver data reading state is
// invalid due to network connection or SMSC responsed with an invalid PDU
// which potentially damages other following PDU(s).
//
// In both cases, Transceiver/Receiver is closed implicitly.
InvalidStreaming
// ConnectionIssue indicates that Transmitter/Receiver/Transceiver is closed
// due to network connection issue or SMSC is not available anymore.
ConnectionIssue
// UnbindClosing indicates Receiver got unbind request from SMSC and closed due to this request.
UnbindClosing
)
// String interface.
func (s *State) String() string {
switch *s {
case ExplicitClosing:
return "ExplicitClosing"
case StoppingProcessOnly:
return "StoppingProcessOnly"
case InvalidStreaming:
return "InvalidStreaming"
case ConnectionIssue:
return "ConnectionIssue"
case UnbindClosing:
return "UnbindClosing"
default:
return ""
}
}