// Common example disconnect logic func CommonDisconnect(n net.Conn, conn *stompngo.Connection, exampid, tag string, l *log.Logger) error { // Disconnect from the Stomp server e := conn.Disconnect(stompngo.Headers{}) if e != nil { return e } l.Printf("%stag:%s consess:%v common_disconnect_complete local_addr:%s remote_addr:%s\n", exampid, tag, conn.Session(), n.LocalAddr().String(), n.RemoteAddr().String()) // Close the network connection e = n.Close() if e != nil { return e } // Parting messages l.Printf("%stag:%s consess:%v common_disconnect_network_close_complete\n", exampid, tag, conn.Session()) l.Printf("%stag:%s consess:%v common_disconnect_ends\n", exampid, tag, conn.Session()) // return nil }