fiorix / go-smpp

SMPP 3.4 Protocol for the Go programming language
MIT License
218 stars 135 forks source link

How to check if transmitter is bound ? #54

Closed Zensey closed 7 years ago

Zensey commented 7 years ago

I want to restrict Send() of message during reconnects. If Bind_tranciever coincide with Submit_sm it causes Bind to fail -- SMSC does not answer on Bind.

Zensey commented 7 years ago

Oh, I have found the way:

    go func() {
        for {
            select {
            case conn_st := <-conn_st_ch:
                c.bound = conn_st.Status() == smpp.Connected
                log.Println("bound>", c.bound, c.id)
            }
        }
    }()
fiorix commented 7 years ago

Cool :)

Let me know if you still need any help and I'm happy to reopen this.