Documentation
¶
Index ¶
- Variables
- func ServeTCP(address string, handler Handler, config *tls.Config) (err error)
- type Conn
- func (c *Conn) Close() (err error)
- func (c *Conn) Done() <-chan struct{}
- func (c *Conn) EnquireLink(tick time.Duration, timeout time.Duration)
- func (c *Conn) PDU() <-chan any
- func (c *Conn) Send(packet any) (err error)
- func (c *Conn) Submit(ctx context.Context, packet Responsable) (resp interface{}, err error)
- func (c *Conn) Watch()
- type Handler
- type HandlerFunc
- type Session
- func (s *Session) Close(ctx context.Context) (err error)
- func (s *Session) EnquireLink(ctx context.Context, tick time.Duration, timeout time.Duration) (err error)
- func (s *Session) PDU() <-chan any
- func (s *Session) Send(packet any) (err error)
- func (s *Session) Submit(ctx context.Context, packet pdu.Responsable) (resp any, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrConnectionClosed = errors.New("smpp: connection closed") ErrContextDone = errors.New("smpp: context done") )
Functions ¶
Types ¶
type Conn ¶
type Conn struct { NextSequence func() int32 ReadTimeout time.Duration WriteTimeout time.Duration // contains filtered or unexported fields }
type HandlerFunc ¶
type HandlerFunc func(*Session)
func (HandlerFunc) Serve ¶
func (h HandlerFunc) Serve(session *Session)
type Session ¶
type Session struct { NextSequence func() int32 ReadTimeout time.Duration WriteTimeout time.Duration // contains filtered or unexported fields }
func (*Session) EnquireLink ¶
func (*Session) Submit ¶
Submit prepares the packet pdu while adding a new sequence to it. Then it calls send and waits for a response if send did not return an error. BUG: blocks Submit until a response is received or the context timed out. As the async enquireLink uses Submit too, this causes issue.
Click to show internal directories.
Click to hide internal directories.