Gets next packet id. If the session is full it won't return till there is free space again
See Implementation
Gets next packet id. If the session is full it won't return till there is free space again