# File lib/jabber4r/session.rb, line 505
505:     def release
506:       begin
507:         @connection.on_connection_exception do
508:           #Do nothing...we are shutting down
509:         end
510:         @connection.send(Jabber::Protocol::Presence.gen_unavailable(id))
511:         @connection.send(Jabber::Protocol.gen_close_stream)
512:       rescue
513:         #ignore error
514:       end
515:       begin
516:         @connection.close
517:       rescue
518:         #ignore error
519:       end
520:     end