diff --git a/errors.go b/errors.go index f2960c0..3b0af6e 100644 --- a/errors.go +++ b/errors.go @@ -12,6 +12,7 @@ var ( ErrRecvWindowFull = NewGenericError("receive window full", false, true) ErrNotHandshake = NewGenericError("first packet is not handshake packet", false, true) ErrConnClosed = NewGenericError("connection closed", false, false) + ErrConnNotFound = NewGenericError("connection not found", false, false) ) type GenericError struct { diff --git a/session.go b/session.go index 6c55fc4..8b2a6e7 100644 --- a/session.go +++ b/session.go @@ -296,6 +296,8 @@ func (session *Session) ReceiveWith(localClientID, remoteClientID string, buf [] if conn, ok := session.connections[connKey(localClientID, remoteClientID)]; ok { conn.SendAck(packet.SequenceId) + } else { + return ErrConnNotFound } }