Skip to content

Commit

Permalink
remove determineIdentifier (auto ID)
Browse files Browse the repository at this point in the history
at least for now, may bring this functionality back

ref #19
  • Loading branch information
nathany committed May 20, 2015
1 parent 54aab15 commit 3fa96ef
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ type session struct {
st sessionState
stm sync.Mutex

id uint32
idm sync.Mutex

err NotificationResult
}

Expand All @@ -79,7 +76,6 @@ func NewSession(conn Conn) Session {
stm: sync.Mutex{},
conn: conn,
connm: sync.Mutex{},
idm: sync.Mutex{},
b: newBuffer(50),
}
}
Expand Down Expand Up @@ -124,9 +120,6 @@ func (s *session) Send(n Notification) error {
return errors.New("not connected")
}

// Set identifier if not specified
n.Identifier = s.determineIdentifier(n.Identifier)

// Serialize
b, err := n.ToBinary()
if err != nil {
Expand Down Expand Up @@ -195,22 +188,6 @@ func (s *session) transitionState(st sessionState) {
s.st = st
}

func (s *session) determineIdentifier(n uint32) uint32 {
s.idm.Lock()
defer s.idm.Unlock()

// If the id passed in is 0, that means it wasn't
// set so get the next ID. Otherwise, set it to that
// identifier.
if n == 0 {
s.id++
} else {
s.id = n
}

return s.id
}

func (s *session) readErrors() {
p := make([]byte, 6, 6)

Expand Down

0 comments on commit 3fa96ef

Please sign in to comment.