connection.go 331 B

1234567891011121314151617181920212223
  1. package peer
  2. type Connection interface {
  3. Raw() any
  4. Peer() *SessionManager
  5. Send(msg []byte) error
  6. Close()
  7. ID() int64
  8. RemoteAddr() string
  9. IsClosed() bool
  10. }
  11. type ConnectionIdentify struct {
  12. id int64
  13. }
  14. func (ci *ConnectionIdentify) ID() int64 {
  15. return ci.id
  16. }
  17. func (ci *ConnectionIdentify) SetID(id int64) {
  18. ci.id = id
  19. }